|
-
March 6th, 2000, 03:46 AM
#1
Background Color of a Panel
Hi there,
I've got a little problem setting the background color of a panel. I've got a Frame which layout is set to null. When I add a panel with a checkboxgroup, and use setBackground(Color.red). The panel is not red only the background of the checkboxes is red.
Can you help me?
Thanx,
Jan Meeuwesen.
-
March 7th, 2000, 08:38 PM
#2
Re: Background Color of a Panel
Jan,
Can you post the code? Or email me with the problem if its a concern.
It sounds like you are setting the background of the checkbox to red, but I'm sure you would have noticed that.
Dustin
-
March 8th, 2000, 03:38 AM
#3
Re: Background Color of a Panel
Hi there and thanx for responding,
I've found out something myselve. If I run my program, I see only colors behing the checkboxes. But if I minimize the window and maximize it again, Then the colors are perfect !! ?? I guess when I open my program java just does not take the time to make the background good. Any ideas???
This is the piece of code I use for setting the color of my Panels:
leftPanel = new Panel(null);
leftPanel.setBackground(Color.gray);
leftPanel.setBounds(0,0,200,400);
middlePanel = new Panel(null);
middlePanel.setBackground(Color.darkGray);
middlePanel.setBounds(200,0,200,400);
rightPanel = new Panel(null);
rightPanel.setBackground(Color.gray);
rightPanel.setBounds(400,0,200,400);
Thanx,
Jan Meeuwesen
-
March 29th, 2001, 03:50 AM
#4
Re: Background Color of a Panel
Try this: first you hide the panel and then you
show it. Whith this you repaint the panel and
when you minimize and maximize it will be repainted too. And with this metod it will be the same i think.
leftPanel.setVisible(false);
leftPanel .setVisible(true);
If your panels laying in another panel
changes "leftpanel" to that panels name.
IK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|