Results 1 to 14 of 14
- 10-20-2008, 12:50 PM #1
[SOLVED] how to cahnge the background color of the frame?
can anyone please tell me how can i change the background color of my form. I am developing a desktop application using NetBeans IDE.
can i use any image/icon as the icon for th frame? if yes, how?
thanks in advance!
regardsThanks and Regards,
- 10-20-2008, 01:04 PM #2
1. One way: change the background color of a JPanel using setBackground(...) and set that JPanel as the contentPane of the JFrame.
- 10-20-2008, 02:20 PM #3
ImageIcon imageBack = new ImageIcon(image_goes_here); JLabel background = new JLabel(imageBack); background.setBounds(0, 0, imageBack.getIconWidth(), imageBack.getIconHeight()); getLayeredPane().add(background, new Integer(Integer.MIN_VALUE)); jPanel1.setOpaque(false); setContentPane(jPanel1);
- 10-21-2008, 08:47 AM #4
how can i replace the java icon with my icon in a JFrame.
I am using NetBeans IDE.
pls tell me.Thanks and Regards,
- 10-21-2008, 09:17 AM #5
- 10-21-2008, 09:24 AM #6
Eranga, I think pranav13 is referring to the title bar icon. The answer to that is at #2, and shouldn't have anything to do with the choice of IDE :)
- 10-21-2008, 09:26 AM #7
- 10-21-2008, 12:29 PM #8
hey, sry i hv clubbed 2 questions n confused u.
i gt the solution from bruke`s suggestion.
Actually, i was trying to set the icon property of the form in properties window in NetBeans IDE. But it is not setting. Thats why i have written it manually using setIconImage().
Thanks for your suggestions!Thanks and Regards,
- 10-21-2008, 12:47 PM #9
Well there is also a property IconImage (and also IconImages) that can be set from the NetBeans property list. But looking at it, it's easier to just write the code yuorself :)
As in the case of many other features of the Visual Editor.
- 10-21-2008, 01:49 PM #10
- 10-21-2008, 01:50 PM #11
thanks darryl bruke!
i got one more problem. I am running a Process in a background thread. and i want to stop that process when i click a button.
i cudnt access the obj of Process from the button click event. i also tried to declare it as static but in vain.
pls suggest me possible workarounds.Thanks and Regards,
- 10-21-2008, 02:05 PM #12
- 10-21-2008, 02:30 PM #13
i ll post it in a new post.
thank you.Thanks and Regards,
- 10-21-2008, 02:32 PM #14
- By jazz2k8 in forum New To JavaReplies: 9Last Post: 01-21-2011, 12:27 PM
- By hungleon88 in forum Advanced JavaReplies: 3Last Post: 08-31-2008, 07:20 AM
- By onefootswill in forum New To JavaReplies: 4Last Post: 08-12-2008, 07:02 AM
- By behrk2 in forum AWT / SwingReplies: 6Last Post: 07-09-2008, 04:54 PM
- By javan00b in forum New To JavaReplies: 3Last Post: 01-29-2008, 11:43 AM