Re: How can i change the background color of a visible JDesktopPane
- From: Alexander.V.Kasatkin@xxxxxxxxx
- Date: Sat, 12 Jan 2008 13:08:04 -0800 (PST)
On 12 янв, 23:17, balla.pe...@xxxxxxxxx wrote:
I tried this things but nothing happened ->
Works fine (in dynamic too).
public class DesktopPaneTest {
public static void main(String[] args) {
final JFrame f = new JFrame("Test");
f.setSize(400, 400);
f.setLocationRelativeTo(null);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JDesktopPane pane = new JDesktopPane();
pane.setBackground(Color.RED);
pane.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
Color background = pane.getBackground();
int r = 0xFF ^ background.getRed();
int g = 0xFF ^ background.getGreen();
int b = 0xFF ^ background.getBlue();
pane.setBackground(new Color(r, g, b));
}
});
JInternalFrame iframe = new JInternalFrame("Test");
iframe.setBounds(10, 10, 200, 200);
iframe.setVisible(true);
pane.add(iframe);
f.getContentPane().add(pane);
f.setVisible(true);
}
}
.
- References:
- How can i change the background color of a visible JDesktopPane
- From: balla . peter
- How can i change the background color of a visible JDesktopPane
- Prev by Date: How can i change the background color of a visible JDesktopPane
- Next by Date: Re: How can i change the background color of a visible JDesktopPane
- Previous by thread: How can i change the background color of a visible JDesktopPane
- Next by thread: Re: How can i change the background color of a visible JDesktopPane
- Index(es):
Relevant Pages
|
|