Results 1 to 3 of 3
Thread: problem making a gui
- 04-04-2011, 02:32 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 30
- Rep Power
- 0
problem making a gui
Hi I use netbeans IDE to build my multithreaded server .
so I built some gui with two buttons Start and Stop and a label called Status(online/offline)
the two buttons have action listeners and in the start button action listener
I put the code below to start the server I run the application and I press start button
and it start the server but the gui server (the jframe stop response) here is the code to start the server :
why this happen and how I fix this ??Java Code:int port_number=2222; try { serverSocket = new ServerSocket(port_number); System.out.println ("SpeedChat Server Is Online!!!"); } catch (IOException e) {System.out.println(e);} while(true){ try { clientSocket = serverSocket.accept(); for(int i=0; i<=9; i++){ if(t[i]==null) { (t[i] = new clientThread(clientSocket,t,"100","",i,clientSocket.getInetAddress().getHostAddress())).start(); break; } } } catch (IOException e) { System.out.println(e);} }Last edited by niba10; 04-04-2011 at 02:35 AM.
-
Read this: Concurrency in Swing.
It will tell you what your problem is (a frozen Event Dispatch Thread) and how to solve it with a SwingWorker object.
- 04-04-2011, 08:37 AM #3
Member
- Join Date
- Feb 2011
- Posts
- 30
- Rep Power
- 0
Similar Threads
-
making an exe from .jar
By ron2794 in forum NetBeansReplies: 3Last Post: 02-04-2011, 08:28 AM -
Facing problem in making connection to mail server
By Basit56 in forum New To JavaReplies: 2Last Post: 01-22-2010, 06:27 PM -
Need help making .jar
By yoodidoo in forum EclipseReplies: 4Last Post: 08-03-2009, 08:57 PM -
How would I go about making something like this...
By split in forum New To JavaReplies: 3Last Post: 07-15-2009, 06:10 AM -
Problem with making/sorting a deck of cards
By Franneldort in forum New To JavaReplies: 9Last Post: 11-07-2008, 12:47 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks