>but since when the JOptionPane is shown, no other input or output will be accepted or sent to the monitor
You couldn't use modal dialog if you want the background process still active.
>1. how to pop up 2 JOptionPane (must be modal) to 2 clients at the same time?
That could be out of control depends on connection speed of 2 clients to server, but
if you know both of connection speeds, you'll know what time you'll send to who (for good measure).
>2. how to set a count down timer to both JOptionPane, so that when the time is up, both JOptionPane will close
You can, here an example:
final JLabel label = new JLabel("");
javax.swing.Timer t = new javax.swing.Timer(1000,
new ActionListener() {
int timeOut = 15; // 15sec
public void actionPerformed(ActionEven
label.setText(""+timeOut--
}
});
t.start(); // Start the time
JOptionPane.showMessageDia
>3. how to close the opposite JOptionPane (before the time is running out?)
It needs to be JDialog instead of JOptionPane (as GrandSchtroumpf said) unless you'll implement your own JOptionPane to handle the inner dilaog.
Main Topics
Browse All Topics





by: GrandSchtroumpfPosted on 2004-03-31 at 15:21:26ID: 10728217
You should use JDialog instead of JOptionPane.