Solved

How to close jdialog without any event?

Posted on 2002-03-03
3
634 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 136
Android development question 2 109
What's wrong with this code? 4 46
ejb on wildfly 5 63
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

738 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