In Netbeans 7.2 when I type in setLookAndFeel(); it says the method isn’t found. What did I do wrong?
import javax.swing.*;
public class SalutonFrame extends JFrame {
public SalutonFrame() throws UnsupportedLookAndFeelException {
super("Saluton Mondo!");
setLookAndFeel();
setSize(350, 100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
To set the look and feel of a frame, you must do it before the constructor, via the UIManager. You can do it like so:
or whatever class your look and feel you want to use is instead of the basic Java look shown in the example. See here for more info.