Results 1 to 13 of 13
Thread: Display on top
- 07-17-2010, 10:05 PM #1
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
- 07-17-2010, 10:24 PM #2
What is is Visibilite? I think you mean. gui.setVisible(true);
:rolleyes: ~ Sno ~ :rolleyes:
'-~ B.S. Computer Science ~-'
- 07-17-2010, 10:34 PM #3
Read the API doc for the JFrame and the Window classes for methods that may do what you want.
- 07-18-2010, 12:39 AM #4
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
- 07-18-2010, 12:56 AM #5
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
You can simply adapt you code to make visible or invisible your JFrame by using setVisible(boolean) method. Something like a...
if(currentTime==(time+a))
{
frame.setVisible(true);
}
if(currentTime==(time+b))
{
frame.setVisible(false);
}If my answer helped you. Please click my "REP" button and add a comment
Have a Good Java Coding :)
- 07-22-2010, 02:06 PM #6
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
Thanks, got notify working.
But now I have another problem, When I start the app the notify class will be loaded. When I change the notify time in the file, then I have to restart my app to get that new time working.
So is there a way to self-restart my app or a way that updates the timer so that it uses that new time?
- 07-22-2010, 03:03 PM #7
How does the app know that the notify time in a disk file has been changed?When I change the notify time in the file, then I have to restart my app to get that new time working.
Does it read the file to get the time when it starts?
Can you explain a bit more about how your app works?
- 07-22-2010, 03:23 PM #8
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
It reads the file when app starts. When I make changes(set new notify time) the notify class dosent know that I have made changes so I have to restart my app to read that file again.
- 07-22-2010, 03:46 PM #9
So if you want you app to recognize that the file has changed without user prompting, you will need the app to capture the date last modified for the file and periodically test the file to see if the date has changed. Another place to use a Timer.
- 07-23-2010, 12:13 PM #10
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
I'm stuck again. I made a timer for renewing the time. I know that I cant return something from a void method. So how can I fix it?
Here is a sample code
Java Code://Recheck time file for changes private Date checkFile(){ int delay = 0; int subseq = 1000; //Recheck time file for changes Timer CheckTimer = new Timer(); //Checked date Date newdate = null; //Scheduled time file check CheckTimer.scheduleAtFixedRate(new TimerTask() { public void run() { <--VOID newdate = DateForTimer(); <--HAVE TO RETURN THIS?!?!+ } },delay,subseq); //Return newdate return newdate }
- 07-23-2010, 12:24 PM #11
Call a method in the surrounding class and pass the value to it.
- 07-23-2010, 04:50 PM #12
Member
- Join Date
- May 2010
- Posts
- 63
- Rep Power
- 0
I just dont get it. Made a FileWatcher what tracks modifications in the time file.
GTimerRunning returns false when the timer file is modified. But now I dont know how to use that boolean to restart the notification timer, I used another timer that
if(GTimerRunning == false){ GTimerRunning = true and run notification timer}.
But it didnt work out as I hoped.
So now I have this code and I dont know how to get it working.
Java Code:public Notify(){ //Check time file for modifications TimerTask task = new FileWatcher(new File("notify.dat")){ protected void Changes(){ GTimerRunning = false; } }; //Modification timer Timer ModiTimer = new Timer(); ModiTimer.schedule(task,0, 1000); //Display main GUI when time is reached Timer TimerGUI = new Timer(); TimerGUI.scheduleAtFixedRate(new TimerTask() { public void run() { dis.setVisible(true); } },RenewDate,fonce_per_day); }
- 07-23-2010, 04:59 PM #13
Similar Threads
-
no display
By Kyle227 in forum Java AppletsReplies: 6Last Post: 07-22-2010, 10:01 AM -
What is the different between Text format display on web browser and display on midle
By Basit781 in forum CLDC and MIDPReplies: 1Last Post: 05-31-2010, 08:46 AM -
Display tag help
By kirtichopra2003 in forum Advanced JavaReplies: 0Last Post: 11-12-2009, 09:10 AM -
How to display a list of items and on click display subitems?
By mandyj in forum New To JavaReplies: 8Last Post: 12-29-2008, 07:12 AM -
How to display information about the display device in SWT
By Java Tip in forum SWTReplies: 0Last Post: 06-28-2008, 09:26 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks