Results 1 to 3 of 3
- 07-24-2008, 02:31 PM #1
[SOLVED] Application should wait until a Dialog closes
Hi Forum,
I have such a silly question, and I think it will be documented anywhere but I did not find anything. I have a JDialog class and I want that my application should wait to execute until this Dialog closes or set any variable to true. I think this is not so hard but I can't get along with that. Here Some Code
And here the callJava Code:public class ConfigurationEditView extends javax.swing.JDialog{ ... ... ... public ConfigurationEditView(boolean first) { super(new JFrame(), false); initComponents(); } public static void showDialog() { Runnable view = new Runnable() { public void run() { ConfigurationEditView cfgView = new ConfigurationEditView(true); cfgView.setVisible(true); cfgView.toFront(); } }; Thread nThread = new Thread(view); nThread.start(); //SwingUtilities.invokeLater(view); } ... ... ... }
Can somebody give me a good example that my application (GUI App) not go on until the callJava Code:ConfigurationEditView.showDialog();
ConfigurationEditView.showDialog();
has returned.
I've tried with a boolean variable in a while loop but that also did'nt work.
Thx for suggestions
- 07-24-2008, 02:44 PM #2
Member
- Join Date
- Jul 2008
- Posts
- 31
- Rep Power
- 0
Java Code:public static void showDialog() { cfgView = new ConfigurationEditView(true); cfgView.setModal(true); cfgView.setVisible(true); System.out.println("Will not display until dialog closed"); }
- 07-24-2008, 02:51 PM #3
Similar Threads
-
What is the execution path of wait() and notify() ?
By AegisCruiser in forum Threads and SynchronizationReplies: 1Last Post: 04-23-2008, 06:16 PM -
How to use sleep() to wait for a while
By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:32 PM -
Launching an application from another application using thread
By Java Tip in forum Java TipReplies: 0Last Post: 02-16-2008, 09:29 PM -
Middle Click Closes Tab Eclipse Plugin 1.0.0
By JavaBean in forum Java SoftwareReplies: 0Last Post: 10-20-2007, 05:59 PM


LinkBack URL
About LinkBacks

Bookmarks