Click to See Complete Forum and Search --> : Dispose of JDialog doesn't work


tbergstedt
May 4th, 2000, 07:34 AM
Being quite new to Java, I am trying to make the simplest form of user input with JOptionPane.showInputDialog (I know it's not recommended, but I don't want to get into custom-made dialogs just yet). All input works fine, but the program doesn't seem to release the threads to the dialogues, resulting in the program hanging at the end of execution.

Here's the code:

JDialog dialog = new JDialog();
tmpAnswer = JOptionPane.showInputDialog (dialog, "Enter new revision");

dialog.hide();
dialog.dispose();




I thought the call to dispose should release threads made to the dialog, but doesn't seem to work. Could somebody tell me what I have done wrong?

Here's the result from a jdb thread call:

Group system:
(java.lang.ref.Reference$ReferenceHandler)0x4 Reference Handler u
(java.lang.ref.Finalizer$FinalizerThread)0x3 Finalizer u
(java.lang.Thread)0x2 Signal Dispatcher u
(java.lang.Thread)0x315 Thread-0 u
Group main:
(java.awt.EventDispatchThread)0xb2 AWT-EventQueue-0 u
(sun.awt.PostEventQueue)0xb5 SunToolkit.PostEventQueue-0 u
(java.lang.Thread)0xb6 AWT-Windows u
(sun.awt.ScreenUpdater)0x2b2 Screen Updater u
(java.lang.Thread)0x2cb TimerQueue u
(java.lang.Thread)0x313 Thread-1 u