Solved

How to close jdialog without any event?

Posted on 2002-03-03
3
639 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

623 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