Results 1 to 3 of 3
Thread: Pauses (or delays rather....)
- 11-17-2007, 06:05 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 6
- Rep Power
- 0
- 11-17-2007, 07:49 AM #2
Member
- Join Date
- Nov 2007
- Posts
- 8
- Rep Power
- 0
Which IDE are you using?
if you are using Netbeans then what you can do is click on the line number once and you will see a red square pop up and then you can click on run->debug
it will run the program up until the red square and then you can click on play button to run the program line by line
- 11-17-2007, 09:44 AM #3
You have two choices:
1 — use a Swing Timer with non-repeating delay, ie, one–time use. There's a page in the tutorial that discusses the use of Swing Timers: How to Use Swing Timers.
2 — use a thread:
This will halt everything: gui response, gui updates, etc; the app will appear to freeze.Java Code:Thread thread = new Thread(new Runnable() { public void run() { try { Thread.sleep(3000); } catch(InterruptedException e) { System.out.println("interrupt"); } } }).start();
Similar Threads
-
Delays by Play announcements
By koni123 in forum Java SoftwareReplies: 0Last Post: 01-08-2008, 09:51 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks