Events from the Timer (Swing!!) HELP

I am working with a timer.. here is the code:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import javax.swing.Timer;
public class TestTimer implements ActionListener
Timer timer;
public TestTimer(int delay)
timer = new Timer(delay, this);
public void start() {timer.start();}
public void stop() { timer.stop();}
public void actionPerformed(ActionEvent e)
System.out.println("Action X_Y");
public static void main (String[] args)
TestTimer tt = new TestTimer(300);
tt.start();
I was expecting as the output of the program the text message "ACTION" each 300 mseconds, but I do not get any output, do you know what it is happening?
Has somebody some simple examples?
Thanks.

Thanks a lot!
I have a last problem with the Event handler and I am not sure why or how to solve it:
import java.io.* ;
import org.w3c.dom.* ;
import javax.swing.Timer;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.io.Serializable;
import org.w3c.dom.* ;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.*;
import java.io.* ;
import javax.swing.event.EventListenerList;
public class testHarners
public File file = null ;
public float auxFloat = 0.0f;
     public testHarners(){
file = new File("C:/temp/ProgramIndexing3.xml");
     public File getFile() {return file ;}
     public void addAuxFloat(float v) {setAuxFloat(auxFloat+v);}
     public void setAuxFloat(float f) {auxFloat = f;}
     public float getAuxFloat() {return auxFloat;}
     public static void main(String[] args)
          testHarners t = new testHarners() ;
          ParserManager p = new ParserManager(t.getFile());
          Document d = p.getDocument();
          ReaderXML reader = new ReaderXML(d);
          int delay2 = 10; //milliseconds
          ActionListener taskPerformer = new ActionListener()
          public void actionPerformed(ActionEvent evt)
                    addAuxFloat(0.01f); // ERROR
          Timer2 t2 = new Timer2(reader, t.getAuxFloat());
          new Timer(delay2,taskPerformer).start();
          while(true)
               try{  Thread.sleep( 3 );  }
               catch( InterruptedException e ){}
The error is inside actionPerformed:
EM\XMLParser\testHarners.java:95: Can't make a static reference to nonstatic variable void addAuxFloat(float) in void actionPerformed(java.awt.event.ActionEvent).
                    addAuxFloat(0.01f);
How could I solve it?
How could I get the time 0.00, 0.01, 0.02, 0.03......?
Thanks!
               

Similar Messages

  • My iPHONE 5 wifi is NOT working when am 3 feet away from router while my iPhone 4s has full signal all the time.Please help.

    My iPHONE 5 wifi is NOT working when am 3 feet away from router while my iPhone 4s has full signal all the time.Please help.

    The problem would seem to be in the firewall in your router.  Have you tried disabling it? I assume you've updated the router firmware, right?  Consider bypassing the ISP provided router (using it as a modem only) and unsing another device such as an Aiport Express.

  • ICal - I have all the events from the past decade listed for this week

    My iCal calendar has every event from the last ten years listed in every day - each event is tagged 'repeat Every day' and 'end Never'. I have a non-corrupted version on my iPhone. I have tried restoring from Time machine and this works but then reverts to this confusion. I even deleted the .plist.
    HELP - my Calendar is my life (and my history)

    Greetings,
    Remove the following to the trash and restart your computer:
    Home > Library > Caches
    Home > Library > Calendars > Calendar Cache, Cache, Cache 1, 2, 3, etc. (Do not remove Sync Cache or Theme Cache)
    Home > Library > Preferences > com.apple.ical (There may be more than one of these. Remove them all.)
    __NOTE: Removing these files will remove any shared (CalDAV) calendars you may have access to. You will have to re-add those calendars to iCal > Preferences > Accounts.
    If the events remain:
    Reset your Sync history: http://support.apple.com/kb/TS1627
    Then restore from your backup.
    If that does not work let us know.

  • Restore an individual iphoto event from a time machine backup!

    Can you restore an individual iphoto event from a time machine backup or do you have to restore an entire library?
    Whilst deleting some old photos from my library i seem to have accidentally deleted an entire event of photos. I regularly backup my iMac using TIme Machine, so was hoping that i could restore this one event. Is this possible and if so how do you do it?
    Any help would be appreciated.
    Thanks

    Greetings Martyn,
    You can restore events from TimeMachine if you like.  Read here.
    Rather than clicking on individual pictures, you click on "Events", highlight the events you want, and then click restore.
    Hope that helps.

  • How can you erase a certain event from the iPad2 but keep it in iPhoto?

    I have two events that were split up by iPhoto when it synced to my iPad2. Collectively there re about 400 photos in the two events and they were split into over 50 separate events some labeled sequentially as 102IMPRT 103IMPRT....and so on, and otehrs labeled with the original event label.   I have not been able to regroup the events. they are still OK as two Events in iPhoto. My latest idea is to try to export the files from iPhoto without the geo and file name to a folder. Erase the events in iPhoto and then reimport them  into new events in iPhoto. Then sync to iPad.
    Before I did all that I wanted to remove the split events from my iPad. I tried to remove them from the iPad by unchecking the source events but checking all others in iTunes before syncing but that doesn't work probably because the pieces all have different names in the iPad. Maybe unchecking the events just doesn't sync them or make any changes..I thought that if you unchecke the events it would remove them. The real problem probably is that the spit events don't exist in iPhoto.
    I did remove them from the iPad once by checking sync with nothing by unchecking iPhoto in iTunes. But that removes the whole library of 10000+ photos. I did that and restored an old library from before the time the events were split (from Time Machine) then resynced with the newest iPhoto and it split the same two events again in pretty much the same way. I got nowhere and it took 4-5 hours to delete and reload the10,000 photos.
    Is there any way to remove events from the iPad that the crazy sync is creating, and don' t exist in your iPhoto library or on your iMac and iTunes without destroying the rest of the library of photos on the iPad??

    I tried syncing with the sources unchecked so no photos would sync. When it got done it erased all the library photos except the messed up events, they remain on the iPad. The Vacation photos are in two albums, one is called camera roll, and the other improted photos. None of the photos were taken with the iPad camera and should not show up in camera roll.
    At this point I am going to restore iPad2 to factory settings and sync from computer not backups and see what happens!

  • Error while deleting events from the integration event queue

    I am trying to delete all the events from the integration event queue after reading it, like this (this is in Java):
            IntegrationEventWS_DeleteEvents_Input input = new IntegrationEventWS_DeleteEvents_Input();
            input.setDateTime("");
            input.setLastEventId("");
            try {
                 ((Default_Binding_IntegrationEventWS)onDemandStub).deleteEvents(input);
            } catch (Exception e) {
                 log.error("Deleting events from integration queue failed: ", e);
            }Alas, I get the following error message:
    Invalid method parameter(s): 'File Id'(SBL-ODS-50007)What does this mean? What is this mysterious "File Id" it supposedly gets? I don't see it anywhere in the SOAP message I'm sending and it isn't mentioned anywhere in the docs.
    Thanks in advance for any input.

    Dont keep this attributes null
    input.setDateTime(""); //Put a Default Time way in
    the past. Ex:"1/1/2000"
    input.setLastEventId(""); //pass the eventIdThe documentation states that those two are optional (although they are not nillable, for some reason). I tried to set the date to today, but I got the same result. Since setting a date is supposed to delete all events older than that date, I don't think setting it in the past will delete anything.

  • Hi can you please help me to fix my iPhone 5 when I update it to the iOS 6.1.2 my carrier signal indicator states searching all the time please help me what to do

    HiHi can you please help me to fix my iPhone 5 when I update it to the iOS 6.1.2 my carrier signal indicator states searching all the time please help me what to do

    Hi Samantha,
    Are you aware that if you restore your ipad that you will lose all data from your ipad and very difficult to get it back unless you had previously made a back-up of your data on itunes or in the cloud. and that would be on the computer you set those up on. (There are some independent apps out there that might help restore data but I don't have any experience with them...)
    Also, I think if you restore on another computer you're supposed to have administrator rights and have the latest itunes update. And I think if you sync (if restoring is considered syncing with another computer, you'll be locked out of your computer or a new one.)
    I don't know if there is a way for you to safely eject your ipad from your mom's laptop and find another way, but please read this
    http://support.apple.com/kb/ts1275
    Also, I suggest you start a new post and title it something like First, stuck on update and now on Restore on another computer. Please HELP! And then tell the story of your problem that you originally included and your follow-up efforts to restore given a suggestion on previous post (though I think you SHOULD AVOID RSTORE if you can.) And refer them to your original post
    https://discussions.apple.com/message/22050045?ac_cid=tw123456#22050045
    Hope this helps and if you can get back to your ios before the upgrade, stay with it. I hope it all works out for you.
    FYI - If it's a new or refurb bought within the past year you might be able to have it replaced by Apple.

  • IPhone 4S has not been backed up from the time I purchased it

    Dear All,
    To my recent notice, my iPhone 4S has not been backed up from the time I bought it (4 months ago). After which everytime I go into the <Back-up now> option, it says that 'Last backup could not be completed'. Any suggestions on solving this please
    Also the Apps I have on my iPhone 4S doesn't appear on my iPad 3.. What could I do to solve these issues? Please help!!
    Thank you..
    JCP

    Jasper C Paul wrote:
    Dear All,
    To my recent notice, my iPhone 4S has not been backed up from the time I bought it (4 months ago). After which everytime I go into the <Back-up now> option, it says that 'Last backup could not be completed'. Any suggestions on solving this please
    Not with they limited information you have provided so far. Are you backing up to iCloud or to iTunes on your computer? Do you have the latest version of iTunes on your computer? Was it installed from a Windows or Mac user ID that had administrator privileges? Does the phone show up in iTunes? What is your operating system? Are you using a USB port directly on your computer (not a hub)? If it's a USB port on the computer and you have a desktop or tower computer is the port on the back, not on the front?

  • Overflow Map has received an inexplicable event from the front map

    Hello, I am posting this to ask if someone can shed additional light on this error. Is it due to incorrect usage of the SafeNamedCache or an internal error?
    2006-12-07 20:33:59.190 Tangosol Coherence 3.1/339 <Warning> (thread=RMI TCP Connection(3)-127.0.0.2, member=1): Overflow Map has received an inexplicable event from the front map; such an event should not have been possible to occur. The Overflow Map will arbitrarily interpret the event in order to maintain its own internal consistency. The likely origin of the event is direct modification of the front and/or back maps managed by the Overflow Map, a MapListener making re-entrant modifications to its source map, or an ObservableMap implementation that reacts to the Map API in a manner inconsistent with the specification (e.g. actively modifying its contents in a manner that differs from the sequence of API calls made against it). This Overflow Map instance will not repeat this warning, and will attempt to silently compensate for subsequent similar event irregularities.
    Event: MapEvent{ObservableHashMap added: key=CalypsoCache|22845412, value=Lease: CalypsoCache|22845412 (Cache=TangosolLock._locks, Size=Unknown, Version=0/0, IssuerId=0, HolderId=0, Status=LEASE_UNISSUED, Last locked at Wed Dec 31 16:00:00 PST 1969)}
    Stack trace follows:
    at com.tangosol.net.cache.OverflowMap.warnUnfathomable(OverflowMap.java:2947)
    at com.tangosol.net.cache.OverflowMap.putInternal(OverflowMap.java:1001)
    at com.tangosol.net.cache.OverflowMap.put(OverflowMap.java:360)
    at com.tangosol.coherence.component.util.CacheHandler.ensureLease(CacheHandler.CDB:15)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.ReplicatedCache.lockResource(ReplicatedCache.CDB:29)
    at com.tangosol.coherence.component.util.CacheHandler.lock(CacheHandler.CDB:3)
    at com.tangosol.coherence.component.util.SafeNamedCache.lock(SafeNamedCache.CDB:1)
    at com.calypso.tk.lock.TangosolLock.acquire(TangosolLock.java:24)
    at com.calypso.tk.lock.DistributedReentrantLock.acquire(DistributedReentrantLock.java:50)
    at com.calypso.tk.util.cache.CalypsoCache.lock(CalypsoCache.java:1772)
    at com.calypso.tk.util.cache.CalypsoCache.getImpl(CalypsoCache.java:1325)
    at com.calypso.tk.util.cache.CalypsoCache.peekImpl(CalypsoCache.java:1320)
    at com.calypso.tk.util.cache.CalypsoCache.peek(CalypsoCache.java:244)
    at com.calypso.tk.util.cache.CalypsoCache.put(CalypsoCache.java:314)
    at com.calypso.tk.core.sql.BookSQL.putInCache(BookSQL.java:314)
    at com.calypso.tk.core.sql.BookSQL.loadAll(BookSQL.java:1494)
    at com.calypso.tk.core.sql.BookSQL.loadAll(BookSQL.java:1158)
    at com.calypso.tk.core.sql.BookSQL.load(BookSQL.java:1186)
    at com.calypso.tk.core.sql.BookSQL.getBook(BookSQL.java:545)
    at com.calypso.tk.core.sql.BookSQL.get(BookSQL.java:237)
    at com.calypso.tk.refdata.sql.UserDefaultsSQL$UserDefaultsLoader.buildObjectFromResultSet(UserDefaultsSQL.java:307)
    at com.calypso.tk.core.sql.SQLObjectPersistor.executeSQL(SQLObjectPersistor.java:399)

    It is quite strange, of course, to have confusion with which config is being used, which is why there is now a log message telling you which config was loaded. I think that the log message was introduced in version 3.1 or 3.2.
    The other thing that I do (at least when testing something) is specify the config on the command line, e.g.
    java -server -Xms128m -Xmx128m -Dtangosol.coherence.cacheconfig=C:\java\dev\test-cache-config.xml -cp coherence.jar;tangosol.jar;...
    BTW, I have downloaded 3.2.1 and will be using that for my tests. So presumably the warning/error will no longer occur? That is our expectation, since it would be a bug (unless you were doing one of the weird things mentioned in the message).
    Keep in mind that even with the message, the Overflow Map keeps going; it is just a warning (albeit a complicated sounding one) that indicates that some internal state (or event stream or lack thereof) is not what was expected as the result of one or more actions.
    I apologize for the inconvenience, and thank you for taking your time to clarify it. We do work hard to avoid this type of issue (or any related confusion), and we have continued to increase our unit and regression test coverage with each release, including with respect to this issue. With that in mind, please do not hesitate to contact us (on this forum if you would like) with suggestions and other feedback; we do want to be aware of the things that our customers are looking for and would like to see improved.
    Peace,
    Cameron Purdy
    Tangosol Coherence: The Java Data Grid

  • Missing classes from the javax.swing package?

    Can anyone throw any light on what appears to be a missing class from the javax.swing package?
    When CelsiusConverter.java from The Swing Tutorial (code fragment shown below) is compiled the JFrame class can't be found.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CelsiusConverter implements ActionListener {
        JFrame converterFrame;Despite the package javax.swing being imported, the compiler does not seem to be be able to find the JFrame class.
    CelsiusConverter.java:14: Class JFrame not found in type declaration.
        JFrame converterFrame;To attempt to solve this issue all the files in jdk1.5.0_02\lib were added to CLASSPATH.
    CLASSPATH was set to C:\Program Files\Java\jdk1.5.0_02\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_02\lib\htmlconverter.jar;C:\Program Files\Java\jdk1.5.0_02\lib\jconsole.jar;C:\Program Files\Java\jdk1.5.0_02\lib\tools.jar;C:\Program Files\Java\jdk1.5.0_02\lib;C:\Program Files\Java\jdk1.5.0_02\lib\ir.idl;C:\Program Files\Java\jdk1.5.0_02\lib\jawt.lib;C:\Program Files\Java\jdk1.5.0_02\lib\jvm.lib;C:\Program Files\Java\jdk1.5.0_02\lib\orb.idl;C:\Program Files\Java\jdk1.5.0_02\demo\jfc\SwingApplet\SwingApplet.jar;.;c:\CoreJavaBook

    This is extremely strange... If you're sure it's not a problem in your code or with your classpath, the only other thing I can think to suggest is re-downloading / installing java

  • Installing WINDOWS - 7 WITH secondary display enabled from the time of installation

    We have MINI ITX motherboard, This board supports multiple display option  VGA, LVDS..For this configuration we prefer only LVDS.
    Currently, we are migrating from LINUX to WINDOWS,Initial installation process does not have any hicups. 
    However, when the installtion completes and ask for a reboot. The system by default switches to VGA and there is no display on lVDS.
    For this we have to connect an VGA display and complete the rest of the installation and set "Duplicate Desktop on Projector" to get the LVDS back.
    We definitely do not require any VGA interference during the installation process. Need some guidance fro enabling  /CLONE display mode from the time of installation.  

    Hi,
    Because of window doesn't embed LVDS driver, that's why LVDS device doesn't work during system installation. You do need to connect another VGA device to complete the installation.
    Another considerable workaround method you can try is that build a Windows image that embed LVDS driver, then use this new image to install Windows 7.
    On the other hand, you can try to install LVDS driver during WinPE phrase, put the driver on other drive or USB drive, then press SHIFT+F10, navigate to the location and install the driver for test. I do have no condition make a test for you, but you
    can have a try by yourself.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How can you retrieve photo's from the time capsule(airport)

    Hi
    I recently had a problem with my mac and had to archive my stuff and put the operating system back on my computer.
    I 'lost' everything however I have been able to get some things back from the time capsule (airport) from previous backups. I can not find my photo's and they are the most important things I want back on my computer.
    Can anyone help? I have tried various things but still can't find them.
    thanks Lorraine

    If you did an Archive and Install, look for your "Previous System" folder and check for iPhoto in it.

  • Restore an individual iphoto event from a time machine backup in Lion

    How can I restore an individual iphoto event from a time machine backup using Lion.
    Thanks

    If you know the file names of the photos you want to restore you can use  Find Any File  to search your Time Machine hard drive for that file.  When it is found you can drag it from the search window to the Desktop and import into iPhoto from there.
    Due to the nature of the Time Machine backup structure each search can take a while.  The search results window will look like this:

  • If OSMFSettings.enableStageVideo true, then click event from the MediaContainer is not dispatch.

    Hi!
    I use org.osmf.vast.mediaVAST2TrackingProxyElement from the VASTLibrary for display advertising and use click to handle advertisement redirection.
    It's works for flash.media.Video.
    But after setting OSMFSettings.enableStageVideo = true, the click event from the MediaContainer is not dispatch.
    Can you please help?

    Actually, I looked briefly at the dev guide this week end, and Stage Video actually renders from the GPU under the Actionscript App.
    It could be something like this:
    Stage video is behind the Actionscript objects and one of them is as big or bigger than the video rendering rectangle and it is grabbing mouse interaction.
    Just speculating.
    Also, I'm not certain StageVideo can recieve mouse events...
    Hope this helps.

  • How can I safe my data back from the Time capsule to iphone and macbook?

    Hi,
    last weekend we were robbed while being on vacation and iphones and macbook air got stolen. Good thing was that at home we had a time capsule and our normal macbook. As soon as we get the new iphones and the new airbook we want to get our itunes and apps and datas back to the iphones and airbook ... can somebody tell us how to re-safe or back-safe stuff from the time capsule back to the equipment?
    Thank you ... I feel so "naked" without my phone :-(
    Virtualkate

    Sorry about your loss. Follow the directions here to use Time Capsule to restore your new Air to the state your old Air was in when stolen. When you first connect your new phones, you'll be given the option of restoring from the backup of your old phones or setting up as new. Restore from your previous backups, followed by syncing your content back to your phones. You should be good to go. Maintaining current backups makes this a piece of cake.
    http://support.apple.com/kb/HT1177

Maybe you are looking for

  • Bridge CS4 HTML Gallery

    All of a sudden, the HTML Gallery option in Output/Web Gallery is gone! It's still available on my laptop, so I can still access it. But where did it go and how can I get it back? I made the mistake of updating the CS4 products...maybe that was it. A

  • Automatically Importing Photos from Finder to iPhoto '11

    Hi there, I save all of my photos to folders on my Drive. I'd like to set up my iPhoto '11 to automatically import photos from these folders to iPhoto each time I add a new photo, the way Picasa does. The only glitch is, I want to have the photos lis

  • I've got a Zen 8gb, but probably going for an iPod because.

    My Zen 8GB is my first mp3 player. This player is really something when it comes to watching videos and movies. I have no major complaints.... But searching the net and discovering more about ipod i finally quit the idea of buying the new Zen 32GB an

  • DB Adapter stops polling

    Hi, We have several processes which are initiated by a DB adapter polling a database table (oracle.tip.adapter.fw.agent.jca.JCAActivationAgent). Recently, the poller processes stopped activating for about a day, then started working again. When the p

  • First Time Making A Call With Skype

    I just bought Skype credit to start making calls for the first time. In the account section I was asked to check my mobile phone for the information code and enter it below. But I need help for what my mobile phone information code is. James Kwegir A