Time refresh doesn't work .... probably flaws in the code. Please help ...
Making a time display and try to keep track of the system time every second. When I pruposely changed the system time for the first time, it worked; another time it wouldn't work and it stopped. Where is the bug please ...
tick_24 = new Timer ( 1000, new ActionListener () {
public void actionPerformed ( ActionEvent ae ) {
times = (GregorianCalendar) Calendar.getInstance ();
int h = times.get(Calendar.HOUR_OF_DAY);
int m = times.get(Calendar.MINUTE);
int s = times.get(Calendar.SECOND);
String time_now = configTime(h,m,s);
// time_display is a JLabel;
time_display.setText(time_now);
times.add(Calendar.SECOND,1);
tick_24.start();
Can't help with the bug, but try this, you might get something out of it
import java.util.*;
import java.text.*;
import javax.swing.*;
import java.awt.*;
class TimeDisplay extends JFrame
private static JLabel lbl = new JLabel();
public static void main(String args[])
new TimeDisplay();
public TimeDisplay()
super("Time Display");
setSize(200,50);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
Container frame = getContentPane();
JPanel jp = new JPanel(new FlowLayout());
jp.add(lbl);
frame.add(jp);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((dim.width - frame.getWidth())/2, (dim.height - frame.getHeight())/2);
setContentPane(frame);
setVisible(true);
startTheClock();
private static void startTheClock()
final java.util.Timer tmr = new java.util.Timer();
tmr.scheduleAtFixedRate(new TimerTask()
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
int ctr;
public void run()
Calendar cal = Calendar.getInstance();
lbl.setText(sdf.format(cal.getTime()));
ctr++;
if(ctr==20) tmr.cancel();
},0,1000);
}
Similar Messages
-
i am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you
Did you check your security software (firewall)?
A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
See:
* [[Server not found]]
* [[Firewalls]] -
i upload my iPhone 4s and it went to recovery mode i have tried to exit recovery mode by pressing the home and the power bottom but it doesn't work what more can i do please help me
http://support.apple.com/kb/ht1808
-
hi,i was about to update my software version of i phone 4,but suddnley power went off.now my phone is not recognised ,and my phone doesn't work,how to reinstall operating system,please help me.....
Put the device in DFU mode: http://www.iclarified.com/entry/index.php?enid=1034
-
Premiere CS4 doesn't work properly with Windows 7 trial - Please help!
Hello!
I have installed the trial version of Windows 7 on my laptop and now my Premiere CS4 doesn't play the timeline in real time anymore. It worked fine with Windows Vista. I have also installed the newest Premiere update, but it didn't help. Is there a patch for Windows 7 (64bit) or will I have to wait until the full version comes out and try it again then?
Thanks in advance for your help.
RafikiIt's a laptop and probably an older one, that means it is probably underpowered.
It's a laptop and that probably means it is a single 5400 rpm disk which is inadequate.
Bill,
Probably good observations. I tend to loose sight of the fact that most laptops are not like mine and forget the common limitations. One mentions "laptop," and I see my Sager - duh! on me.
To the OP, this ARTICLE might also offer some tips on getting your computer ready for an NLE session. Common references are to how things are done in XP-Pro (my OS), but you should be able to "read between the lines," and adapt the general concepts to Win7 and your setup.
Also, giving full specs. on your laptop might help greatly, otherwise we're all just guessing. Bill brings up a couple of critical points. Your details will either point to them, or dismiss them.
Good luck,
Hunt -
Web Camera doesn't work on my Lenovo G570 laptop, Please Help?
Well I recently bought a lenovo G570 laptop. The webcam worked fine for the first month. I don't really know when the camera stopped working but it seems that every software that uses a camera can detect the camera but when the video window pops up it is just plain white. I know the reason isn't because of the hot key FN+ESC because it works fine, I can disable and enable the camera. I read many threads with the same problem. I uninstalled and re-installed the drivers and easy capture but it does not solve my problem. Can someone please help?
As I understand the camera is not working.
If the camera is getting activate by Fn+Esc key then it could be driver issue.
You need to uninstall the camera software and other relates software.
Update the BIOS and then install the camera drier
Download the BIOS update for Windows 7 32bit from the mentioned below web link.
http://consumersupport.lenovo.com/us/en/DriversDownloads/drivers_show_4480.html
Download the BIOS update for Windows 7 32bit from the mentioned below web link.
http://consumersupport.lenovo.com/us/en/DriversDownloads/drivers_show_4481.html
After updating the BIOS install the camera driver.
http://consumersupport.lenovo.com/us/en/DriversDownloads/drivers_show_4138.html
Best Regards,
Tanuj
Did someone help you today? Press the star on the left to thank them with a Kudo!
If you find a post helpful and it answers your question, please mark it as an "Accepted Solution".! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
Follow @LenovoForums on Twitter! -
I have tried to download Adobe flash player 3 times, NOTHING HAS HAPPENED, HELP!!!!!!!!!!!!!
Hello Kathie,
Sorry for the inconvenience that has caused to you.
Please let me know if you have tried converting any other PDF to word with Reader.
Alos, please sign up at "https://cloud.acrobat.com/" using your Adobe ID credentials. Click on 'ExportPDF' tab and upload the PDF that you want to convert to Word.
Let me know if this converts fine.
Hope to hear from you.
regards,
Anubha -
Please help me!!!
Maybe your account was hijacked. If you didn't change your password that is quite likely. Contact Apple Account Security by going here: http://support.apple.com/kb/HT5699
-
please help
Hi there xian0623,
You may find the troubleshooting steps in the article below helpful.
iPhone: Troubleshooting a cellular data connection
http://support.apple.com/kb/TS3780
-Griff W. -
my I pad 2 sends sound to the tv via apple tv but it won't work with the mirroring function the option for mirroring is not there please help
So go over the basics.
I pad on ios 5 or better.
Apple tv on version 4.4
Both on same wireless network.
Doulbe tap home button to get task bar. Swipe so you see the leftmost screen. Next to the volume slider should be the box and arrow. Click that and the toggle switch for mirroring should appear.
If not, using your apple remote, wake up the apple tv, and move around the menu a little, then try again. -
Since installing mavericks my WD time machine doesn't work, it keeps insisting it needs more space? This wasn't an issue an hour earlier?
Id also like to know if Powerpc software will be supported? I have C&C Generals on disc but it doesnt run now mavericks is installed?!
Annoying!Regarding time machine, it probably took a full backup after you put mavericks on. To investigate, open Console, select "All Messages" and type "backup" (without the quotes). It will then only show you backup-related messages. If you're not sure how to read those, copy them and paste them into a reply here; we can investigate the situation.
I don't know anything about your PPC software issue, sorry. -
IMac: Time Machine Doesn't Work
The time machine doesn't work it says it can't find any wireless devices (Airport cant find any wireless devices)? I'm connected to the internet so shouldn't it work?
Help please.Would love some help..
-
I bought the iphone 5 has not been one week do not understand why the home key of the time activities at stops working, not crash or fall. hope its help, probably due to software, not hardware failure, what do I do now?
Restore iPhone with current iTunes on computer. See if better. If still problem, make Genius reservation or set up Service and take or send to Apple for resolution. Of if easier for you, take receipt and iPhone, box and everything and return to where you bought it.
-
Hi I am using iphone 4, since last few days i am facing problem in touch screen at times it doesn’t work at all for 5-10 mins and then it works out itself. Can anyone pls suggest what the problem is and how it can be sorted out?
Did you recently updated to 7.0.4? Even for me same also issues.
-
# Question
I get this message when I try to open my google shared docs this week: "A browser error has occurred. Please hold the Shift key and click the Refresh button to try again." - but that click/refresh doesn't work either. What's up?The backend end is in serious pain....on many levels.
Try this: Connection Problems Form
Maybe you are looking for
-
New Update to Edge Reflow CC Available!
Today, we are pleased to announce that an update to Edge Reflow is now available. Included in this release are the following new features: Multi-page design: On the right side of Reflow's design surface (below the recently added 'Assets Panel' and ab
-
How to expose a file in XI 3.0?
Hi friends, I have the requeriment to expose a wsdl file in SAP XI 3.0 SP 24. As everyone know this version hasn't a service registry. Also the client needs in the URL the clausule wsdl? . I was thinking to create a SICF service in order to response
-
Apple Pay - Card Design Not Reflected in Passbook
I started using Apple Pay yesterday, and all of my cards loaded quickly and easily. However, the card designs on my Citi cards (I have 2), are not being reflected. When loaded into Apple Pay, they are just generic looking cards, not the actual design
-
Action listener in different class
Hi I now have a class called Gui and a class called Listener. The gui contains public class Gui implements ActionListener public void actionPerformed(ActionEvent e) { }the Listener contains public class Listener extends gui implements ActionListener
-
If Apple has a specification for any of these, I couldn't find it. It's obviously not on the Aperture web site under tech specs. I couldn't find it in the user manual, but I have been known to stink at searching the manual. I did some searching on th