public static void setLookAndFeel() {
try {
UIManager.setLookAndFeel(new GTKLookAndFeel());
} catch (UnsupportedLookAndFeelException ex) {
try {
UIManager.setLookAndFeel(new WindowsLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception exc) {
throw new RuntimeException(exc);
}
}
}
}
try {
ОтветитьУдалитьtry {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
}
} catch (UnsupportedLookAndFeelException ex) {
try {
UIManager.setLookAndFeel(new MetalLookAndFeel());
} catch (UnsupportedLookAndFeelException ex1) {
System.out.println("Это ж нереально!");
}
}