Javax.swing.Timer not working or event not being captured by actionPerfrmd

Here is the code:
public class nQueensEst extends JApplet implements ActionListener {
  public Timer t = new Timer(1, this);
//...the actionPerformed:
if(e.getSource() == jButton1){
            nRainhas=Integer.parseInt(javax.swing.JOptionPane.showInputDialog("Quantas rainhas voc? deseja?"));     
            t.start();
            int contadorTentativas=1;
            for(int i=0; i<=100; i++){
                sol=new int[nRainhas];
                while(!rainhas()){
                  jLabel1.setText(contadorTentativas +" tentativas!!!");
                  contadorTentativas++;            
                jLabel2.setText("Solu??es: "+Integer.toString(i));
t.stop();
}else if(e.getSource() == t){
     System.out.println("timer");
     rodadas++;
Any clue?
Thanks

Let me explai the context: i had to implement a classic nQueens problem using a Grasp Algorithm and a Backtrack algorithm, then in dorder to compare them, i want to make the garap one to run find 100000 solutions and register the time it is needes, then divide by 100000. so i need the timer running and making a variable increase every millisecond from the beggining until the end of the last solution. But the timer is not generating a event or the event is not being caought by the actionPerformed.

Similar Messages

  • Command Link in ADF table is not working/ PPR event not getting fired

    Hi All,
    I am having ADF Table, in that one column is with command link if click on command link, it is not navigating to corresponding page or method of a bean. If i give same command link out of the table it working fine, this issue i am facing is in IE9.
    if i use IE in compatibility mode the links works fine, even in IE8 version also.
    Browser: IE 9
    Jdev version: 11.1.1.5.0
    I tried all possible things, but nothing workout for me.
    showPopupBehavior not working in IE9 for af:table buttons (jdev11.1.1.5.0)
    Partial page rendering not working in ie9
    Command Link in ADF table is not working
    Thnks

    Hi,
    please file a bug if you have a customer support contract and provide a testcase
    Frank

  • My Ipad 2 is not working. Is not tuening On. I dont' know what's happening. I'm trying to turn on and I have no ansewr. Screen is out, nothing come to the screen.

    My Ipad 2 is not working. Is not turning On. I dont' know what's happening. I'm trying to turn it on and I have no answer. Screen is out, nothing come to the screen. Battery is ok at 60% charged when I turned off last time, and after minutes when I turned on, it not worked anymore. If somebody have an idea what may happenning, please let me know.

    I don't know what yu mean by "screen is out" but try this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Problem description: mac mail not opening, software updates not working, app store not opening. imac osx 10.9.5

    Problem description:
    mac mail not opening, software updates not working, app store not opening. 10.9.5
    EtreCheck version: 2.0.11 (98)
    Report generated 1 December 2014 16:51:49 CET
    Hardware Information: ℹ️
      iMac (21.5-inch, Late 2009) (Verified)
      iMac - model: iMac10,1
      1 3.06 GHz Intel Core 2 Duo CPU: 2-core
      12 GB RAM Upgradeable
      BANK 0/DIMM0
      4 GB DDR3 1067 MHz ok
      BANK 1/DIMM0
      4 GB DDR3 1067 MHz ok
      BANK 0/DIMM1
      2 GB DDR3 1067 MHz ok
      BANK 1/DIMM1
      2 GB DDR3 1067 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      NVIDIA GeForce 9400 - VRAM: 256 MB
      iMac 1920 x 1080
      BenQ GL2240 1920 x 1080 @ 60 Hz
    System Software: ℹ️
      OS X 10.9.5 (13F34) - Uptime: 1:32:17
    Disk Information: ℹ️
      WDC WD5000AAKS-40V2B0 disk0 : (500.11 GB)
      S.M.A.R.T. Status: Verified
      EFI (disk0s1) <not mounted> : 210 MB
      Macintosh HD (disk0s2) /  [Startup]: 499.25 GB (164.03 GB free)
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      HL-DT-ST DVDRW  GA11N 
    USB Information: ℹ️
      EPSON EPSON Epson Stylus S22 Series
      Canon MX410 series
      ASMedia AS2105 1 TB
      S.M.A.R.T. Status: Verified
      EFI (disk3s1) <not mounted> : 210 MB
      Backup (disk3s2) /Volumes/Backup : 999.86 GB (506.24 GB free)
      Apple Inc. Built-in iSight
      Apple Internal Memory Card Reader 7.95 GB
      S.M.A.R.T. Status: Verified
      EOS_DIGITAL (disk1s1) /Volumes/EOS_DIGITAL : 7.94 GB (7.83 GB free)
      Western Digital My Book 1140 2 TB
      S.M.A.R.T. Status: Verified
      EFI (disk2s1) <not mounted> : 210 MB
      2TB (disk2s2) /Volumes/2TB : 2.00 TB (1.50 TB free)
      Wacom Co.,Ltd. CTE-450
      Contour Design ShuttlePRO v2
      Apple Computer, Inc. IR Receiver
      Apple Inc. BRCM2046 Hub
      Apple Inc. Bluetooth USB Host Controller
    Gatekeeper: ℹ️
      Mac App Store and identified developers
    Kernel Extensions: ℹ️
      /Applications/Parallels Desktop.app
      [not loaded] com.parallels.kext.hidhook (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.hypervisor (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.netbridge (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.usbconnect (9.0 24217.979618) Support
      [not loaded] com.parallels.kext.vnic (9.0 24217.979618) Support
      /Applications/Toast 10 Titanium/Toast Titanium.app
      [not loaded] com.roxio.BluRaySupport (1.1.6) Support
      /Library/Extensions
      [loaded] at.obdev.nke.LittleSnitch (4052 - SDK 10.8) Support
      [not loaded] xxx.qnation.PeerGuardian (1.1.9) Support
      /System/Library/Extensions
      [not loaded] com.FTDI.driver.FTDIUSBSerialDriver (2.2.18 - SDK 10.6) Support
      [not loaded] com.pctools.iantivirus.kfs (1.0.1) Support
      /Users/[redacted]/Library/Services/ToastIt.service/Contents/MacOS
      [not loaded] com.roxio.TDIXController (2.0) Support
    Startup Items: ℹ️
      ParallelsDesktopTransporter: Path: /Library/StartupItems/ParallelsDesktopTransporter
      WkSvMacX: Path: /Library/StartupItems/WkSvMacX
      Startup items are obsolete and will not work in future versions of OS X
    Launch Agents: ℹ️
      [running] at.obdev.LittleSnitchUIAgent.plist Support
      [not loaded] com.adobe.AAM.Updater-1.0.plist Support
      [loaded] com.adobe.CS4ServiceManager.plist Support
      [running] com.epson.epw.agent.plist Support
      [loaded] com.oracle.java.Java-Updater.plist Support
    Launch Daemons: ℹ️
      [running] at.obdev.littlesnitchd.plist Support
      [failed] com.adobe.fpsaud.plist Support
      [loaded] com.adobe.versioncueCS4.plist Support
      [loaded] com.barebones.textwrangler.plist Support
      [running] com.cleverfiles.cfbackd.plist Support
      [not loaded] com.gopro.stereomodestatus.plist Support
      [loaded] com.microsoft.office.licensing.helper.plist Support
      [loaded] com.oracle.java.Helper-Tool.plist Support
      [loaded] com.oracle.java.JavaUpdateHelper.plist Support
      [invalid?] com.tvmobili.tvmobilisvcd.plist Support
      [loaded] fi.polar.libpolar.plist Support
      [running] fi.polar.polard.plist Support
      [failed] xxx.qnation.PeerGuardian.kextload.plist Support
    User Launch Agents: ℹ️
      [loaded] com.adobe.ARM.[...].plist Support
      [loaded] com.facebook.videochat.[redacted].plist Support
      [loaded] com.google.keystone.agent.plist Support
      [loaded] com.macpaw.CleanMyMac.helperTool.plist Support
      [loaded] com.macpaw.CleanMyMac.trashSizeWatcher.plist Support
      [running] com.macpaw.CleanMyMac.volumeWatcher.plist Support
      [invalid?] com.plexapp.helper.plist Support
      [not loaded] com.spotify.webhelper.plist Support
    User Login Items: ℹ️
      Garmin Express Service Application (/Applications/Garmin Express.app/Contents/Library/LoginItems/Garmin Express Service.app)
      SmartDaemon Application (/Library/Application Support/CleverFiles/SmartDaemon.app)
      SilverKeeper Scheduler ApplicationHidden (/Applications/SilverKeeper.app/Contents/Resources/SilverKeeper Scheduler.app)
      Dropbox Application (/Applications/Dropbox.app)
      Garmin ANT Agent UNKNOWN (missing value)
    Internet Plug-ins: ℹ️
      DirectorShockwave: Version: 11.5.7r609 Support
      Google Earth Web Plug-in: Version: 6.1 Support
      Default Browser: Version: 537 - SDK 10.9
      Flip4Mac WMV Plugin: Version: 3.2.0.16   - SDK 10.8 Support
      PandoWebInst: Version: 1.0 Support
      AdobePDFViewerNPAPI: Version: 10.1.12 Support
      FlashPlayer-10.6: Version: 15.0.0.189 - SDK 10.6 Support
      DivXBrowserPlugin: Version: 2.0 Support
      Silverlight: Version: 5.1.10411.0 - SDK 10.6 Support
      Flash Player: Version: 15.0.0.189 - SDK 10.6 Mismatch! Adobe recommends 15.0.0.239
      iPhotoPhotocast: Version: 7.0 - SDK 10.8
      QuickTime Plugin: Version: 7.7.3
      SharePointBrowserPlugin: Version: 14.0.0 Support
      AdobePDFViewer: Version: 10.1.12 Support
      GarminGpsControl: Version: 4.2.0.0 - SDK 10.8 Support
      JavaAppletPlugin: Version: Java 7 Update 71 Check version
    User Internet Plug-ins: ℹ️
      fbplugin_1_0_3: Version: (null) Support
    Safari Extensions: ℹ️
      Open in Internet Explorer
    Audio Plug-ins: ℹ️
      DVCPROHDAudio: Version: 1.3.2
    3rd Party Preference Panes: ℹ️
      Adobe Version Cue CS4  Support
      DivX  Support
      Flash Player  Support
      Flip4Mac WMV  Support
      GoPro  Support
      Growl  Support
      Java  Support
      MacFUSE  Support
      MenuMeters  Support
      Perian  Support
    Time Machine: ℹ️
      Skip System Files: NO
      Auto backup: NO - Auto backup turned off
      Destinations:
      Back Up [Local]
      Total size: 0 B
      Total number of backups: 0
      Oldest backup: -
      Last backup: -
      Size of backup disk: Excellent
      Backup size 0 B > (Disk size 0 B X 3)
    Top Processes by CPU: ℹ️
          12% Google Chrome
          12% WindowServer
          4% Dock
          2% Little Snitch Agent
          2% SystemUIServer
    Top Processes by Memory: ℹ️
      399 MB iTunes
      322 MB mds_stores
      216 MB Google Chrome Helper
      193 MB Google Chrome
      155 MB com.apple.IconServicesAgent
    Virtual Memory Information: ℹ️
      6.64 GB Free RAM
      3.51 GB Active RAM
      1.36 GB Inactive RAM
      1.11 GB Wired RAM
      1.91 GB Page-ins
      0 B Page-outs

      [not loaded] com.pctools.iantivirus.kfs (1.0.1) Support
    Un-install according to the developer's un-install instructions.
    You do not need to use cleaning programs. They can destroy your computer operation as they may already have done.
    CleanMyMac - Uninstall
    CleanMyMac2 Un-install
    After un-installing, run this program to make sure you got all the pieces.
    EasyFind – Spotlight Replacement
    Do a backup.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.appstore.plist. Move the .plist to your desktop.
    Restart, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • I bought Adobe Elements 12; I cannot use panorama photomerge, I have followed the directions to go to Full Edit  mode in edit workspace choose File New Photomerge. However the Photomerge does not work, it does not respond.   The only thing I can come u

    I bought Adobe Elements 12; I cannot use panorama photomerge, I have followed the directions to go to Full Edit  mode in edit workspace> choose File> New> Photomerge. However the Photomerge does not work, it does not respond.
    The only thing I can come up with is that I found a blog that said that in the Trial version Photomerge does not work, however I do Not have the Trial version, I did at one time but I purchase Adobe Elements. Thank you.

    The blog was incorrect. Photomerge should work in the trial, too.
    When things get weird in PSE the first thing to do is to delete the prefs. Go to the editor preferences>general, click this button and restart the editor:

  • My ipad2 media volume not working, volume bar not showing

    My ipad2 media volume not working, volume bar not showing

    here are my similar symptons:
    in Settings the volume slider bar when moved plays a sound out of the speaker
    when you double press home button, and slide over to the brightness and volume slider bars, the volume slider is completely gone.
    when you plug in headphones it works fine, volume rocker controls volume perfectly.
    when you press volume rocker without headphones, nothing happens, or a blank "sound effects" icon displays.
    I sent my Ipad2 to Apple for this under warranty.  They said there are some small scratches on the side of it. 
    It lives in a heavy duty case, but the exposed area has been knicked some how.    The little divots in the metal on the side mean that "impact" must have broken it. 
    Forget the fact that it spontaneously started happening and that the speakers and headphones both work at various times, and the volume rocker works, but iOS 5.1.1 apps can't send sound out the speaker, but the volume settings in the sound do send out sound..
    so they refused to look at it or repair it under the warranty.   I was a day away from buying yet another apply device in our family that already has a couple iPod Touches and 2 iPads.  I think I'll buy a droid now.

  • TS1718 I tried to update, did not work, unintstalled did not work.  Now when I try to install i get error message "The feature you are trying to use is on a network resource tha is unabailable.  Looking for itunes64.msi path.

    I tried to update, did not work, unintstalled did not work.  Now when I try to install i get error message "The feature you are trying to use is on a network resource tha is unabailable.  Looking for itunes64.msi path.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Help ! inaccurate time recorded using javax.swing.timer

    Hi All,
    I am currently trying to write a stopwatch for timing application events such as loggon, save, exit ... for this I have created a simple Swing GUI and I am using the javax.swing.timer and updating a the time on a Jlabel. The trouble that I am having is that the time is out by up to 20 seconds over a 10 mins. Is there any way to get a more accruate time ?? The code that I am using is attached below.
    private Timer run = new Timer(1000, new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
    timeTaken.setText("<html><font size = 5><b>" + (df.format(timeHours)) + ":" + (df.format(timeMins)) + ":"
    + (df.format(timeSeconds++)) + "</b></font><html>");
    receordedTimeValue = ((df.format(timeHours)) + ":" + (df.format(timeMins)) + ":"
    + (df.format(timeSeconds)));
    if (timeSeconds == 60) {
    timeMins++;
    timeSeconds = 0;
    if (timeMins == 60) {
    timeHours++;
    timeMins = 0;

    To get more accurate time you should use the System.currentTimeMillis() method.
    Try this code :
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CountUpLabel extends JLabel{
         javax.swing.Timer timer;
         long startTime, count;
         public CountUpLabel() {
              super(" ", SwingConstants.CENTER);
              timer = new javax.swing.Timer(500, new ActionListener() { // less than or equal to 1000 (1000, 500, 250,200,100) 
                   public void actionPerformed(ActionEvent event) {
                        if (startTime == -1) {          
                             count = 0;               
                             startTime = System.currentTimeMillis();
                        else {
                             count = System.currentTimeMillis()-startTime;
                        setText(getStringTime(count));
         private static final String getStringTime(long millis) {
              int seconds = (int)(millis/1000);
              int minutes = (int)(seconds/60);
              int hours = (int)(minutes/60);
              minutes -= hours*60;
              seconds -= (hours*3600)+(minutes*60);
              return(((hours<10)?"0"+hours:""+hours)+":"+((minutes<10)?"0"+minutes:""+minutes)+":"+((seconds<10)?"0"+seconds:""+seconds));
         public void start() {
              startTime = -1;
              timer.setInitialDelay(0);
              timer.start();
         public long stop() {
              timer.stop();
              return(count);
         public static void main(String[] args) {
              JFrame frame = new JFrame("Countdown");
              CountUpLabel countUp = new CountUpLabel();
              frame.getContentPane().add(countUp, BorderLayout.CENTER);
              frame.setBounds(200,200,200,100);
              frame.setVisible(true);
              countUp.start();
    Denis

  • My Iphone 5 voice speaker is not working.I'm not able to hear the voice of the person calling.But when I put my iphone 5 on speaker mode, things seem ok.Please provide me some suggestions.

    My Iphone 5 voice speaker is not working.I'm not able to hear the voice of the person calling.But when I put my iphone 5 on speaker mode, things seem ok.Please provide me some suggestions.

    Hello rizvijunaid,
    Thank you for providing the details of the issue you are experiencing with calls on your iPhone.  I recommend following the steps in the article below for the issue you described:
    iPhone: Receiver and call audio quality issues
    http://support.apple.com/kb/ts5196
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • HT1904 How can I get a refund for apps in the apple App Store that do not work and are not what they said they wer

    How can I get a refund for apps in the apple App Store that do not work and are not what they said they wer

    You've tried deleting and redownloading them and seeing if they then work and tried contacting the developers ? If you have and they can't/won't help then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes support via this page : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • SSRS 2008 R2 Calendar Control not working and report not refreshing on pressing enter in Chrome.

    SSRS 2008 R2 Calendar Control not working and report not refreshing on pressing enter in Chrome.

    SSRS reports are always best viewed in IE and the report result what you see in IE always will not be same and consistent in thirdy party browswers.
    So consider using IE as workaround.
    Also please refer:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/2188de10-cff9-4e24-b14f-da5121f1c4a4/ssrs-calender-control-not-visible-in-chorme-on-server?forum=sqlreportingservices
    Workaround here:
    http://www.rajbandi.net/Fixing-SSRS-Report-Viewer-control-date-picker-in-Google-chrome/
    -Vaibhav Chaudhari

  • IPod model A1059, freezes, unresponsive to all click wheel entries.  Reset does not work.  Does not show up in ITunes or on windows explorer.  What is the problem and how do I fix it?

    IPOD model A1059 appears frozen and is unresponsive to all click wheel entries. Reset does not work.  Does not show up in ITunes or in Windows Explorer.  What is the problem and is there a fix?

    If you are unable to reset the iPod (assuming the hold switch is not in the On position either), then you'll have to let the iPod's battery fully drain. Then connect it to a charger and leave it to charge for a couple of hours.
    B-rock

  • Why does iTunes keep giving me bogus error messages.  "Your internet connection is not working, check your connection and try again."  My internet is working fine.  iTunes is not working and will not allow me to download tunes.

    why does iTunes keep giving me bogus error messages.  "Your internet connection is not working, check your connection and try again."  My internet is working fine.  iTunes is not working and will not allow me to download tunes.

    This my sound too simple, but I just kept clikning on the arrow next to the selected music and it finally "Kicked" in.
    I live in Europe ,So Be persistent and don't give up !  Aug. 2013

  • HT5364 Adobe flash player not working on Safari after being installed, System OS X 10.9.2 has been just updated to Maverick

    Adobe flash player not working on Safari after being installed, System OS X 10.9.2 has been just updated to Maverick

        Enable Plug-ins
        Safari > Preferences > Security
        Internet Plug-ins >  "Allow  plug-ins"
        Enable it.
        Click "Manage Website Settings"
        Highlight "Adobe Flash Player", "Allow" and then "Done".

  • My home button not working...not becauze the version,it's like broken, how can i fix it?i'vs just buy it 4 months ago

    My home butyon is not working...not becauze the version,it's like broken, how can i fix it ? I just bought it 4 months ago.
    Thanks

    i have that same issue, i recently had my ipod sent off to apple and they sent me a refurbished ipod, all was great till i discovered that my home button was not very responsive like it should be. If you have any luck finding out how to fix this problem will you please pass on the information. And i will do the same as to how to fix the issue and passing along the information
    Thanks
    Thomas

Maybe you are looking for

  • Using 2 iPhones with 1 library (different tunes).

    I have had an iTunes library and had all of our music in it at one time. I have to add more. My wife and I recently bought iPhones and would like to use the same library (all music is in the cloud) to listen to different music. Right now, we have sep

  • "Do you want to erase this iPhone?"

    Hi all- My wife and I recently got iPhones. My plan for my wife's phone is to sync the calendar with her Windows machine at work and everything else with our Mac at home. More details here: http://discussions.apple.com/thread.jspa?threadID=1719958&ts

  • How to fill up pdf forms & sign pdf contracts using digitizer pen & tablet?

    Greetings, I travel a lot and bring tons of documents for clients to sign. As I am trying to cut down on travel weight, i fancied upon the idea of using a digitizer such as the Genius EasyPen i405 to fill up pdf forms and sign contracts so i wouldnt

  • Error 10846 occurs only if DMA mode for transfer ist selected

    Hello, my problem is if I use the DMA mode to for transferring data to the PCs memory always the error 10846 occurs. I perform the buffered semiperiod measurement with a continuous buffer (circular buffer). I tried to use Interrupts. The error does n

  • What does this error message mean: "Please acquire a new SIM (H5006)"

    I tried accessing my cellular data and got this screen: "The SIM is currently active and not available for activation on this device" "Please acquire a new SIM (H5006)" Any ideas why this would happen? Thanks, Ron