연구 프로젝트의 일환으로 일부 사용자가 개발 한 Java 응용 프로그램을 작성 중입니다. 주요 방법은 다음과 같은 : 이벤트 큐를 사용하는 대신 단지 이벤트 대기열을 사용하여 main()에서 간단한 메소드 실행
public static void main(String[] args) {
//the MAC stuff!!
XX.getInstance(); //this line creates the UI and the event handlers
}
EventQueue의를 사용하여 어떤 의미가 있습니까
를 사용하는 이유public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
// Change the name of the application on a mac
System.setProperty("com.apple.mrj.application.apple.menu.about.name",
"XX");
// Use the top of the screen for the menu on a mac
if(System.getProperty("mrj.version") != null) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
try {
// Use system look and feel
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
System.out.println("Cannot use system's look and feel; using Java's default instead");
}
// Create a new instance of XX
XX.getInstance();
}
});
}
을 이제 이해가 안 돼요?
+1 위반은 쉽게 진단 할 수 있지만 예방하기 쉽습니다. 더 [여기] (http://stackoverflow.com/q/3643174/230513) 및 [여기] (http://stackoverflow.com/q/6445143/230513). – trashgod