LookAndFeel
To change the lookandfeel for example to "windowslookandfeel" you will have to add UIManager.setLookAndFeel to your code :: see sample
buildregistration.java [ full example code : see 19-05-2008 ]
package formbuilding;
import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException;
import formbeans.Registration;
public class BuildRegistration {
public BuildRegistration(String title) { JFrame f = new JFrame(title); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } Registration r = new Registration(); f.setLocation(200, 200); r.formRiverLayout(f); f.pack(); f.setVisible(true);
}
public static void main(String[] args) { BuildRegistration br = new BuildRegistration("Registration");
} }
|