2-panel signaling
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   sender_jones
Posted On:   Wednesday, August 24, 2005 05:41 AM

I have 2 panels in my frame. First display left pane while right pane is empty. Left pane has a button on which when clicked, start a processing. In the middle of the processing, it displays the right pane and then pause there. The right pane has input text and button. When user finish with the input text and click the button, then the right pane disappears and the processing in the left pane continue at the break point. My problem is: how to pause the left pane and wait the the right pane signal? How can the right pane signal the left pane for it to continue? I've tried this: at the break point, left pane to start a new thread for right pane and then loop a sleep until a text field is updated by right pane. But the result:   More>>

I have 2 panels in my frame. First display left pane while right pane is empty. Left pane has a button on which when clicked, start a processing. In the middle of the processing, it displays the right pane and then pause there. The right pane has input text and button. When user finish with the input text and click the button, then the right pane disappears and the processing in the left pane continue at the break point.


My problem is: how to pause the left pane and wait the the right pane signal? How can the right pane signal the left pane for it to continue?


I've tried this: at the break point, left pane to start a new thread for right pane and then loop a sleep until a text field is updated by right pane. But the result: the sleep of the left pane also freeze the right pane.


Any solution?

   <<Less

Re: 2-panel signaling

Posted By:   Almagest_FUTT  
Posted On:   Wednesday, August 24, 2005 11:06 AM

Oh, and consider using the static JOptionPane.show... methods. They're quite convenient.

Re: 2-panel signaling

Posted By:   Almagest_FUTT  
Posted On:   Wednesday, August 24, 2005 11:04 AM

Pass an Object as a lock to the "right pane" when "left pane (...) start a new thread for right pane", then call Object.wait() on it.

In the "right pane", when the input is done, call Object.notify().


And think about separation of model and view (and controller).

About | Sitemap | Contact