0
ecilpse에서 JavaFX 프로그램을 작성하고 있습니다. 내 로컬 컴퓨터에서 잘 작동합니다. 즉, 내 보낸 후 실행 가능한 jar를 실행할 수 있습니다. 그러나 실행 가능한 jar 파일을 다른 컴퓨터에 저장하면 UI가 응답하지 않습니다. 다음은 javaFX 프로그램을 시작한 코드입니다.JavaFX UI가 응답하지 않습니다.
@Override
public void start(Stage primaryStage) {
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent e) {
Platform.exit();
System.exit(0);
}
});
this.primaryStage = primaryStage;
this.primaryStage.setTitle("Server Simulator");
context = new ClassPathXmlApplicationContext("classpath:PrTrSim.xml");
this.displayQueue = (LinkedBlockingQueue<Message>) context.getBean("displayQueue");
this.userInputQueue = (LinkedBlockingQueue<Message>) context.getBean("userInputQueue");
this.outgoingQueue = (LinkedBlockingQueue<Message>) context.getBean("outgoingQueue");
this.incomingQueue = (LinkedBlockingQueue<Message>) context.getBean("incomingQueue");
addQueue.add(this.displayQueue);
addQueue.add(this.outgoingQueue);
addQueue.add(this.incomingQueue);
initRootLayout();
showSimOverview();
}
public static void main(String[] args) {
launch(args);
}
는 PrTrSim.xml 큐가 메시지 수신 및 처리 용으로 차단 behind.The 4를 실행하는 두 개의 구성 요소 (messageProcessor 및 SocketIO 리더)을 초기화한다. 이름 용의자로, http://docs.oracle.com/javafx/2/threads/jfxpub-threads.htm
음 : – eckig
MessageProcessor 및 SocketConnector를 Platform.Runlater()를 사용하여 시작하면 해결됩니다. 이제는 작동하는 것 같습니다. 당신은 작업 UI를 시작하는 코드를 넣어야한다는 것을 의미합니까 ?? –