Solved

How to close jdialog without any event?

Posted on 2002-03-03
3
617 Views
Last Modified: 2008-01-09
I'm showing JDialog and after some time(say thread.sleep(1000), dialog should dispose automatically.
 is their any way to achieve it?

Thanks,
0
Comment
Question by:vibhav
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
daitt earned 30 total points
ID: 6837581
Create another thread and close the dialog in that thread.
Or you can use class Timer.
class Closer extends Thread{
int time;
JDialog target;
public Closer(int time, JDialog target){
this.time = time;
this.target = target;
start();
}
public void run(){
try{
sleep(time);
}
catch (InterruptedException e){
e.printStackTrace();
}
target.setVisible(true);
target.dispose();
}
}
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6956320
Please click the link below to manage all your open and locked questions here needing your response and attention.
http://www.experts-exchange.com/jsp/memberProfile.jsp?mbr=vibhav&showQHistory=true
Moondancer - EE Moderator
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6960024
Please tell us why you graded this with a "B" grade versus "A".  The points to you are the same, but the expert points which flow are a direct result of the grade you assigned.  We ALWAYS appreciate knowing why grades less than "A" are given.  If you found additional information outside of this question thread, we'd also like to know that since it adds value to this item as it has moved to our PAQ and can help others.  
Thanks, listening further.
Moondancer - EE Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now