Results 1 to 6 of 6
- 11-15-2010, 09:15 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 5
- Rep Power
- 0
- 11-16-2010, 02:59 AM #2
Senior Member
- Join Date
- May 2010
- Posts
- 436
- Rep Power
- 4
It works for me:
You're bug is somewhere else in code not shown.Java Code:import java.awt.*; import javax.swing.*; public class Test1 { public static void main(String[] args) { JButton blueBtn = new JButton("Blue Button"); blueBtn.setBackground(Color.blue); JButton redBtn = new JButton("Red Button"); redBtn.setBackground(Color.red); JPanel panel = new JPanel(new GridLayout(1, 0, 5, 0)); panel.add(blueBtn); panel.add(redBtn); JOptionPane.showMessageDialog(null, panel, "Blue Button Test", JOptionPane.DEFAULT_OPTION); } }
- 11-16-2010, 05:19 AM #3
Like maybe setting a custom Look and Feel.You're bug is somewhere else in code not shown.
db
- 11-16-2010, 08:17 PM #4
Member
- Join Date
- Nov 2010
- Posts
- 5
- Rep Power
- 0
Well, I guess the problem has to do with mac osx... Because I just copy and pasted the code curmudgeon supplied, and I got this:

Do you have any idea why?
- 11-16-2010, 08:25 PM #5
Member
- Join Date
- Aug 2010
- Posts
- 23
- Rep Power
- 0
Same here, also OS X. Seems to be platform specific behavior.
- 11-16-2010, 09:22 PM #6
Member
- Join Date
- Nov 2010
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
Detecting color change and clicking a button. awt.robot not fast enough?
By doejohn in forum New To JavaReplies: 3Last Post: 06-27-2010, 02:57 AM -
Change the color in my program
By carl in forum New To JavaReplies: 5Last Post: 04-03-2009, 12:20 PM -
How to Change the color of MultiColumnListBox
By Java.child in forum AWT / SwingReplies: 1Last Post: 01-22-2009, 12:07 AM -
How to change string Color
By Java.child in forum AWT / SwingReplies: 3Last Post: 01-06-2009, 04:27 AM -
How to change TXT color Onclick
By dave700800 in forum New To JavaReplies: 1Last Post: 12-08-2007, 01:39 AM


LinkBack URL
About LinkBacks

Bookmarks