Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Updating GUI dynamically

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Location
    Dublin
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Updating GUI dynamically

    Hello,

    I have some problems with making my two classes communicating with each other.
    I have one class client.java that contains methodes for initializing internet connection, sending packages and listening for packages. Other class is a gui class where the connection will be started and different things can be send to server depending which button has been pressed. My problem is that i don't know how to make my client class contsantly listening for incoming data and updating it in gui.

    Thanks in advance
    Regards


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Updating GUI dynamically

    how to make my client class constantly listening for incoming data and updating it in gui.
    "Waiting for incoming" sounds more like a Server than a Client.
    Can you describe how/why your client is waiting? Normally clients send a request and read the response.
    Does the client call a blocking method to wait for input?
    Is the waiting code in its own thread?

  3. The Following User Says Thank You to Norm For This Useful Post:

    KrisTheSavage (August 29th, 2010)

  4. #3
    Junior Member
    Join Date
    Mar 2010
    Location
    Dublin
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Updating GUI dynamically

    Thanks for reply.

    Yest its a client but i want it to be in constant communication wit a server so that is why i want it to be able to recieve data from server.

    Can you describe how/why your client is waiting? Normally clients send a request and read the response.
    Oh is it?? Well yes that would actually be even better for my code. Sorry I'm quite new in all this and the way I was thinking was that server as well as client must keep listening for incoming data.

    So what you saying is that client must send a request to server in order to get data??

    Does the client call a blocking method to wait for input?
    Is the waiting code in its own thread?
    Right now it does not wait because i wasn't really sure how to do it


    So OK now, i think its sorted. I'm gonna make client sending a requests to server.

Similar Threads

  1. dynamically resizing 2d array
    By Flamespewer in forum Collections and Generics
    Replies: 2
    Last Post: March 2nd, 2010, 11:10 AM
  2. MouseMotionListener is not updating my variable
    By olemagro in forum AWT / Java Swing
    Replies: 1
    Last Post: February 8th, 2010, 03:44 PM
  3. updating database
    By gurpreetm13 in forum JDBC & Databases
    Replies: 3
    Last Post: October 9th, 2009, 11:43 AM
  4. [SOLVED] How to dynamically create ArrayLists (or something similar)?
    By igniteflow in forum Collections and Generics
    Replies: 4
    Last Post: August 6th, 2009, 06:00 AM
  5. Add Jmol applet dynimically in JSF(java server faces)
    By megha in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: May 15th, 2009, 06:16 AM