Servus
hab da ein kleines Problem mit dem LookAndFeel wollte das mein jFrame aussieht wie Windows aber irgendwie gehts ned.
hier mein Code vieleicht weiß ja einer von euch wo da mein Fehler ist.
public class Test{
public static Root start = new Root();
public static void main(String[] args) {
String laf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
//String laf="javax.swing.plaf.metal.MetalLookAndFeel";
//String laf = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
try {
UIManager.setLookAndFeel(laf);
//SwingUtilities.updateComponentTreeUI(start.getContentPane());
// If you want the Cross Platform L&F instead, comment out the above line and
// uncomment the following:
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException exc) {
System.err.println("Warning: UnsupportedLookAndFeel: " + laf);
} catch (Exception exc) {
System.err.println("Error loading " + laf + ": " + exc);
}
start.show();
//dienst zum einlesen der Default werte
Connect.openDB();
Connect.readall();
}
}
//SwingUtilities.updateComponentTreeUI(start.getContentPane());
wenn ich diesen befehl rein Nehme bekomm ich immer ne NullPointer Exeption aber mein Frame hat auf einmal ein aussehen wie Windows und nicht mehr wie Metal
Danke Mfg
hab da ein kleines Problem mit dem LookAndFeel wollte das mein jFrame aussieht wie Windows aber irgendwie gehts ned.
hier mein Code vieleicht weiß ja einer von euch wo da mein Fehler ist.
public class Test{
public static Root start = new Root();
public static void main(String[] args) {
String laf = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
//String laf="javax.swing.plaf.metal.MetalLookAndFeel";
//String laf = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
try {
UIManager.setLookAndFeel(laf);
//SwingUtilities.updateComponentTreeUI(start.getContentPane());
// If you want the Cross Platform L&F instead, comment out the above line and
// uncomment the following:
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException exc) {
System.err.println("Warning: UnsupportedLookAndFeel: " + laf);
} catch (Exception exc) {
System.err.println("Error loading " + laf + ": " + exc);
}
start.show();
//dienst zum einlesen der Default werte
Connect.openDB();
Connect.readall();
}
}
//SwingUtilities.updateComponentTreeUI(start.getContentPane());
wenn ich diesen befehl rein Nehme bekomm ich immer ne NullPointer Exeption aber mein Frame hat auf einmal ein aussehen wie Windows und nicht mehr wie Metal
Danke Mfg