muliLessa
asked on
GridLayout, BackgroundColor
I have a JPanel with a GridLayout, which contains 3rows and 3 cols of JToggleButtons:
setLayout(new java.awt.GridLayout(iMax,j Max,0,0));
this.setBackground(Color.w hite);
this.setBounds(0,0,ID.togg leX*3,ID.t oggleY*3);
The backgroundcolor of the JoggleButtons is currently white.
When compiled in Eclipse, there are grey lines in between the JoggleButtons, when compiled
in NetBeans there are no such lines.
How can I assure that those lines are not displayed?
setLayout(new java.awt.GridLayout(iMax,j
this.setBackground(Color.w
this.setBounds(0,0,ID.togg
The backgroundcolor of the JoggleButtons is currently white.
When compiled in Eclipse, there are grey lines in between the JoggleButtons, when compiled
in NetBeans there are no such lines.
How can I assure that those lines are not displayed?
ASKER
Thx, colr!
...its showing as different in the gui designers: Yes, therefore I think that "something is missing"
in my code, which is "added" in NetBeans, but not in Eclipse.
I tried Your solution, but getContentPane() does not work for a JPanel.
...its showing as different in the gui designers: Yes, therefore I think that "something is missing"
in my code, which is "added" in NetBeans, but not in Eclipse.
I tried Your solution, but getContentPane() does not work for a JPanel.
Sorry, try setting the background directly on the JPanel instead
ASKER
I am doing that (see above: this.setBackground(Color.w hite);
this is a class which extends JPanel).
I guess that perhaps the background of the gridlayout should be set - but
I don't know how to achieve that.
this is a class which extends JPanel).
I guess that perhaps the background of the gridlayout should be set - but
I don't know how to achieve that.
I suspect it is more likely to be the component which the JPanel has been added to, the content pane of the window itself
ASKER
The component which contains the JPanel is a LayeredPane, which has (needs to have) the BG-color brown - so it can't be responsible for the grey lines between the gridcomponents.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thx objects! That's it!
getContentPane().setBackgr