Hi,
I'm trying to create a simple JFrame with a button on it, but I want this button to look like a native system one.
Here's the code
package tests; import java.awt.Button; import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class MyFrame extends JFrame { private Button _button; public MyFrame() throws ClassNotFoundException, InstantiationException, UnsupportedLookAndFeelException, IllegalAccessException { this.setLayout(null); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); _button = new Button("My Button"); _button.setSize(100, 30); _button.setLocation(10, 20); this.add(_button); this.setSize(400, 300); this.setVisible(true); } }
But all I get is this:
It doesn't look like a Windows 7 button at all.
What am I doing wrong?