Results 1 to 3 of 3
  1. #1
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default Synchronization problems

    Hi guys,
    I have a problem with a program in Java and I'd like to know your opinion.

    I explain to you:
    I have one interface graphical (JFrame) with a button that when it is touched executes a code that realizes a set of tasks.
    What I want is that, as the above mentioned code is executed, visualize information about his evolution in the graphical interface.

    When I still don't have the interface, it was showing the messages across the exit (with a System.out.println) . But when I have tried to put the interface, the messages do not go out until the whole code has been executed.
    My question is: how can I do that messages can be visualized in dynamic way?

    thanks
    Last edited by Jack; 06-04-2007 at 09:17 PM.

  2. #2
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    Default

    You can use threads, a thread for each task, give them low priorities, and a thread with the highest priority to the task that does the visual interface, and then put it in sleep the time that you consider necessary.
    Think that with this schema the secondary threads will not execute in a sequencial order,
    your tasks musn't depend on the others task, so you don't have problems of synchronization

  3. #3
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    Default

    as Ed says, try with threads.
    If you don't know how to use it I can send you a good tutorial
    just let me know
    heather

Similar Threads

  1. synchronization question
    By oguz in forum Threads and Synchronization
    Replies: 2
    Last Post: 07-22-2008, 09:56 AM
  2. Synchronization Doesn't seem to work
    By sherinpearl in forum Threads and Synchronization
    Replies: 1
    Last Post: 04-23-2008, 07:30 PM
  3. Replies: 0
    Last Post: 11-10-2007, 05:47 PM
  4. problems with JPA
    By Ed in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 06:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •