0
UIManager.setLookAndFeel
함수를 사용하여 Java 응용 프로그램의 모양을 변경하려고했지만 내 JFrame
/단추의 시각적 모양에는 영향을주지 않습니다. Netbeans 7.4
을 사용하고 신청서는 Java Swing Desktop Application
입니다.UIManager setLookAndFeel이 작동하지 않습니다.
/**
* Main method launching the application.
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
} catch (Exception e) {
System.out.println(e.getMessage());
}
System.out.println("init");
launch(JavaMysqlTestApp.class, args);
}
나는
- 을
com.sun.java.swing.plaf.motif.MotifLookAndFeel
javax.swing.plaf.metal.MetalLookAndFeel
com.sun.java.swing.plaf.gtk.GTKLookAndFeel
UIManager.getSystemLookAndFeelClassName()
UIManager.getCrossPlatformLookAndFeelClassName()
그러나 그 중 누구도 내 동료의 모습을 변경하지 않았습니다. 이 기능을 어떻게 적용시킬 수 있습니까?
'launch (JavaMysqlTestApp.class, args);가 다른 응용 프로그램을 실행합니까? – alex2410
'java application'이 아닌'java desktop application'입니다. 그래서 내가 생각하기에 그 confusion이 나온다. 이제'@Override protected void startup()'함수에서'UIManager.setLookAndFeel' 메서드를 사용했습니다. 이제 작동합니다! – Fer