메시지가 표시되는 프레임이있는 Java 소켓 서버를 만들려고합니다.프레임이있는 JAVA SocketServer
하지만 프레임 생성자에서 서버를 실행하면 프레임이 보이지 않습니다.
내 코드의 일부입니다 :
프레임 호출 :
public ServerForm() throws IOException {
initComponents();
hipServer Server = new hipServer();
}
서버 생성자 : 서버 만들기
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
new ServerForm().setVisible(true);
} catch (IOException ex) {
Logger.getLogger(Ship_Server.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
을
public ShipServer() throws IOException {
ServerSocket listener = new ServerSocket(8901);
System.out.println("Server is Running");
try {
while (true) {
...
}
} finally {
listener.close();
}
}
당신을 수는 제안 서버를 실행하고 액티브 프레임을 살아야합니까? "결코"형태 (그것을 확인을
또는
디스플레이를 종료하지
감사합니다. 내게 도움이되었습니다. – Edgar
당신은 환영합니다 :) – Reimeus