Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to close jdialog without any event?

Posted on 2002-03-03
3
Medium Priority
?
641 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 90 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

824 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