Results 1 to 2 of 2
Thread: Change colour of JOptionPane
- 04-25-2011, 05:08 PM #1
Member
- Join Date
- Apr 2011
- Posts
- 9
- Rep Power
- 0
Change colour of JOptionPane
I need to change the colour of a button in a JOptionPane. How my program works is when a button is pressed a JOptionPane appears and displays a message and I need to change the colour of the button text in the JOptionPane. Here's the code for the option pane:
thanksJava Code:UIManager um=new UIManager(); um.put("OptionPane.background",new ColorUIResource(100,200,255)); um.put("Panel.background",new ColorUIResource(100,200,255)); um.put("OptionPane.messageForeground", Color.blue); button.titleLabel.textColor = (UIColor blueColor); JOptionPane.showMessageDialog(null, "It takes approximately 1 hour and 5 minutes to go from Nottingham to Leicester", "Time", JOptionPane.PLAIN_MESSAGE);
-
Similar Threads
-
Jtable colour cell problem
By fuzzdn in forum New To JavaReplies: 10Last Post: 07-30-2011, 05:30 PM -
changing JFrame colour
By simo_mon in forum AWT / SwingReplies: 0Last Post: 08-08-2009, 02:15 AM -
Changing text colour in code
By dbashby in forum New To JavaReplies: 2Last Post: 04-29-2009, 03:32 PM -
Colour Specific Cell within Table
By poddy88 in forum New To JavaReplies: 2Last Post: 04-14-2009, 08:20 AM -
[SOLVED] Change text colour on conditions in netbeans
By dbashby in forum New To JavaReplies: 0Last Post: 03-26-2009, 01:23 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks