Jump to content

Can't write in the jTextField when program start

- - - - -

  • Please log in to reply
1 reply to this topic

#1
00145217

00145217

    Newbie

  • Members
  • Pip
  • 5 posts
Hello, I have some question regarding the Java GUI,
This is the first time I ever written a program with GUI.
I am writing a Java bluetooth server that will sends two number to the client
I got the server part ok in the cmdline and the server and client were able to communicate.
Now with the GUI these are all element I have
jTextField1: FirstNumber
jTextFeild2: SecondNumber
jButton1: StartServer
jButton2: SetNumber
So when I press StartServer the program is suppose to start the server and enter a while() loop to wait for message from the client.
While that is happening I am suppose to be able to type in the FirstNumber and SecondNumber box and hit the SetNumber so that it change the number to be send to the client.

The problem I am having is that when I hit the StartServer, the whole GUI freeze. I assume it's the problem with the while() loop running in the background.

Is that any better way I can do this?
Thank you very much
Best Regard

#2
00145217

00145217

    Newbie

  • Members
  • Pip
  • 5 posts
I'm sorry, I just got it from searching Java Interrupt from google.
I use the Thread to do it.
Thank you




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users