Click to See Complete Forum and Search --> : How do I let JDialog implement Runnable interface
DarkAge
August 21st, 2000, 08:32 AM
Hi
I want to make a JDialog class to run in another thread. I've tried to implement Runnable, but the display gets messed up, because i call start() instead of show(). It seems that JDialog.show() must be called.
What do i do ?
Do i override JDialog.show() ? and if so then how ?
Does it have something to do with being modal or not ?
thanks in advance.
DarkAge
August 22nd, 2000, 02:44 AM
anybody ???
Norm
August 23rd, 2000, 01:42 PM
What do you want the dialog to do that it needs a thread? You can use both methods:
Use show() in the constructor to display the dialog.
Use start() to start the run() method of the thread.
mbauer
August 23rd, 2000, 04:11 PM
Create a sub-class of JDialog.
Michael Bauer
DarkAge
August 24th, 2000, 04:11 AM
allow me to be more specific.
i have a subclass of jdialog which performs copying of different files with a progress bar. i want to be able to open several dialog which each is performing some kind of copy. so i want all the dialogs multitasking.
i've tried to call this.show() in the run() method but when the dialog draws it messes up the dialog display.
so now im trying something else.
i've removed the runnable interface, so no threads. ive made the dialog box non-modal. now it draws properly, but other windows will not accept events.
heres an example:
i call a copying dialog
now i go to another window and click in a list. the other window will not recieve this click until the copy dialog is finished and closed. how can i make other windows accept events ??
any help is appreciated and thanks in advance.
Norm
August 24th, 2000, 12:29 PM
Sorry, I've never written a program that works just that way. Can you send me a stripped down version that demonstrates the problem without a lot of extra code?
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.