Results 1 to 4 of 4
Thread: window background color?
- 01-23-2008, 10:16 AM #1
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
- 01-23-2008, 11:24 PM #2
If your window is a JFrame, JDialog or JWindow you can try
If it is a Frame of Window you can tryJava Code:myFrame.getContentPane().setBackground(yourColor)
JOptionPanes take a little more work.Java Code:myRef.setBackground(color)
- 01-24-2008, 04:23 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Little explanation on this.
You can do this in this way as well.
In this way, when you run the application, background color flashes and gone. That is because the frame made up of mane components involving. That's why we used a "Content Pane" in the hardwired code.Java Code:myFrame.setBackground(yourColor)
- 01-29-2008, 10:43 AM #4
Member
- Join Date
- Jan 2008
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Center background image
By Floetic in forum AWT / SwingReplies: 1Last Post: 04-24-2008, 05:50 PM -
How to make the JTextArea background invisible
By bradder in forum AWT / SwingReplies: 1Last Post: 12-05-2007, 06:30 PM -
Set the background in Java
By barney in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:13 AM -
Background image in java
By toby in forum AWT / SwingReplies: 1Last Post: 07-29-2007, 07:15 AM -
Why this image background is black ?
By samson in forum Java 2DReplies: 1Last Post: 07-17-2007, 04:24 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks