Creating labels while program is running

hey guys,
im working on a program that will shoot jlabels as bullets, but am having trouble creating the jlabels in program...
heres my code
private javax.swing.JLabel[] shot = new javax.swing.JLabel[10000];
public void fire()
     if(direction==0)
     shot[shots] = new javax.swing.JLabel();
     shot[shots].setLocation(100,100);
     shot[shots].setText("TESTING");
     shot[shots].setVisible(true);
its weird, the label is created because i tested by doing...
otherlabel.setLocation(shot[shots].getX(),shot[shots].getY());
and the otherlabel will move to a location
any ideas?

Did you read the link to the add() documentation?
If you intend to add it to the frame you would say:
shot[shots] = new javax.swing.JLabel("TESTING");
shot[shots].setLocation(100,100);
    // not needed
//shot[shots].setText("TESTING");
//shot[shots].setVisible(true);
shooterForm.add(shot[shots])Note that since you are setting the position of the label the frame (or rather its content pane) should have a null layout.

Similar Messages

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • How to open log file while program is running?

    Hi,
    I am using log4j to generate a log file. The application connects to a remote server and does some updates on a database. Is it possible to view the log file while the program is running? When I click on the log file to open it, I get a message "the document is in use by another application and cannot be accessed".
    Looking for ideas to get around this problem.
    Thanks and Regards,
    Harsha Hegde

    tail.exe -f
    Tail is a Unix program but if you search google you can find a port for Windows. It will show the contents of the file in a cmd prompt and will update as new lines are being added to the file so you can see the most up-to-date version as log4j is writing to it.

  • ML Sleeps While Programs are Running

    Twice now, my iMac running Mountain Lion has fallen asleep while a program is actively running.  (Ex. Encoding a movie in Handbrake and burning a BD disc with Toast.)  Does anyone know why this is happening?  I have never had issues with my Mac sleeping during such processes before. I actually count on this because I very often walk away as these longer processin tasks run and/or start them when I toddle off to bed.  I hope this is something I can resolve and not a bug.

    According to Ars Technica:
    "In Mountain Lion, OS X no longer pays attention to disk activity when deciding if it's OK to put the system to sleep. Instead, Apple recommends that applications make what Apple calls "power assertions" as a way to tell the OS when they're doing some useful work that the system should stay awake for. This policy allows the OS to put the system to sleep the moment there are no applications still holding power assertions to prevent the action."
    Apparently the "caffeinate" terminal command can be used in conjunction with specific processs to keep your machine awake until the process completes but it also seems that apps will have to be updated to comply with this new power management protocol. I've noticed the problem with Retrospect 9, HandBrake and RipIt so far...
    I have not figured out the terminal commands for using caffeinate with these apps—if anyone has some pointers I would be grateful.
    Thx

  • Open .lvm file while program is running

    How do I open a .lvm file within my program? I've tried using the Open/Create/Replace File dialog with File Dialog specifying the path and I can get to the point to select the path, and it doesn't open the file.
    Solved!
    Go to Solution.

    Can you please post your code so we can see what you are doing.
    Cory K

  • Update Audio Devices while program is running

    Hi
    I want to connect an audio device while a labview VI is running. When I do so, the audio device doesn't appear in the audio device list. Is there any activeX node or other possibility to refresh the audio devices in labview while a VI is running?
    I'm using Windows XP and LabVIEW 2010, but I think an upgrade to 2011 wouldn't solve my problem.
    Solved!
    Go to Solution.

    Hi Kolja,
    just talked to a colleague about the issue and we solved it now. The solution are VI references and reference calls.
    Take a look in the example in the attachment. Using this piece of code the "Get Num Devices" function (as an example for every other function you wish to use) is reloaded everytime it is called, resulting in updated device counts at runtime.
    Good luck using it and best regards,
    Benjamin
    Attachments:
    Audio Dynamic LV2010.zip ‏10 KB

  • SessionStorage warning while program is running

    Hi,
    I have a desktop application that I developed in NetBeans. Everything compiles and runs, but whenever I open a specific window, I get the following warning:
    Feb 18, 2008 2:47:12 PM org.jdesktop.application.SessionStorage restoreTree
    +WARNING: No saved state for javax.swing.JTabbedPane[prefsTabs,10,11,408x228,layout=javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=201326944,maximumSize=,minimumSize=,preferredSize=,haveRegistered=false,tabPlacement=TOP]+
    The application has several windows, and only one gives such a warning. The entire GUI layout was done with the NetBeans Swing GUI builder. I have looked around online, and I have not been able to find any documentation that will help with this problem. Does anyone have any ideas as to what could be causing this, and/or how it can be remedied?
    Thanks,
    Peter

    I get the same Warning when i open a window that contains a JTable. No idea what I should do to make it go away.
    Apr 11, 2008 6:24:33 PM org.jdesktop.application.SessionStorage restoreTree
    WARNING: No saved state for javax.swing.JTable[jTable,0,0,461x1200,alignmentX=0.0,alignmentY=0.0,border=,flags=251658568,maximumSize=,minimumSize=,preferredSize=,autoCreateColumnsFromModel=true,autoResizeMode=AUTO_RESIZE_SUBSEQUENT_COLUMNS,cellSelectionEnabled=false,editingColumn=-1,editingRow=-1,gridColor=javax.swing.plaf.ColorUIResource[r=128,g=128,b=128],preferredViewportSize=java.awt.Dimension[width=450,height=400],rowHeight=16,rowMargin=1,rowSelectionAllowed=true,selectionBackground=javax.swing.plaf.ColorUIResource[r=51,g=153,b=255],selectionForeground=javax.swing.plaf.ColorUIResource[r=255,g=255,b=255],showHorizontalLines=true,showVerticalLines=true]

  • Solution to JTable SessionStorage warning while program is running

    I have a Netbeans developed Desktop Application showing the following warning:
    WARNING: No saved state for javax.swing.JTable ...There is a now locked forum thread on this topic: [http://forums.sun.com/thread.jspa?threadID=5265745]
    I think this happens if you are using a JTable with no resizable columns. This is what I found digging in the org.jdesktop.application.SessionStorage source code:
    When the SessionStorage.save() method is called to save the application state ( the class org.jdesktop.application.SingleFrameApplication calls it during application shutdown),
    for each JTable object in the application, the org.jdesktop.application.SessionStorage.TableProperty.getSessionState() method is called to get a org.jdesktop.application.SessionStorage.TableState
    object that is supposed to contain the target JTable state information to be saved.
    Unfortunately if the target JTable has no resizable columns the getSessionState() method returns null (this is IMHO a bug !) and this produces an inconsistent saved state that when the application is restarted, causes a null to be retrieved as the JTable state to restore, giving the warning message.
    The solution is simple: each JTable object with no resizable columns must have no name, i.e.:
    myTable.setName(null)If a component has a null name the save state method ignores it and the warning disappears.
    Surprisingly enough, this solution is exactly the opposite of the solution proposed in the previous thread.

    the table.setName(null) worked for me but my tables also have table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    I still don't know what's going on but I appreciate the tip. The warnings are now gone.
    Joe

  • Proactively preventing F110 errors - Accounts are blocked while F110 is running

    I was wondering what other companies are doing to mitigate F110 Payment Run errors in advance.
    We perform some pre-processing to validate proposals.. but an issue we sometimes run into is that a Customer or Vendor Account is locked (typically because someone is in CHANGE mode XD02 / XK02). 
    Other than locking those transactions while F110 is running, are there other options? also, if someone is in change mode and then goes to lunch, this lock won't help .
    When that happens, every single invoice is excluded for that customer/company code combination.
    Are you guys able to mitigate that issue? If so, what did you implement?
    Thanks,
    Robert.

    Hi,
    If not a bad idea, you can think of creating a wrapper program which runs F110 in background.
    This program should take payment run date and ID as input and start the payment run.
    Program will check the locks of all the vendors and customers involved in the payment run. If all the locks are free, then it can start F110 background job. If there is a lock, it can keep running till the lock is released and start F110 as soon as lock is released.
    Note: Even this approach might have limitations.
    Say you check lock for vendor 1-no lock
    check lock for vendor 2-no lock
    start payment run-vendor 1 is locked.
    It may fail in this case. So, this is not 100% automated. But works in most of the cases.
    Will keep you posted if some crazy idea strikes my mind
    Thanks,
    V V

  • HT2542 Hi, I created a new user on mac, Admin but i can't use adobe CS6 while the original user is admin too and all programs are running normal. How can i solve this problem?

    Hi, I created a new user on mac, Admin but I can't use adobe CS6 while the original user is admin too and all programs are running normal. How can I solve this problem?

    Hi Amanda,
    Software applications are usually installed in the Applications folder on the Macintosh HD and are accessible to all users.
    I would advise you to check the Applications folder and see if your software is in there.
    Next step would be to Control Click or Right Click on the application and choose "Get Info" and make sure the permissions are set to "Read & Write" for all users. The article below provides more details:
    Troubleshooting permissions issues in Mac OS X
    http://support.apple.com/kb/ht2963
    You may need to contact Adobe Support if this does not resolve your issue:
    http://helpx.adobe.com/photoshop.html
    Hope this information helps!
    - Judy

  • While trying to run it show error message : "The application or DLL C:\Program Files\Mozilla Firefox\sqlite3.dll is not a valid Windows image. Please check this against your installation diskette

    Just updated firefox. While trying to run it show error message : "The application or DLL C:\Program Files\Mozilla Firefox\sqlite3.dll is not a valid Windows image. Please check this against your installation diskette." Tried to download and install new firefox, but it alway show that the file is corrupt
    == Today ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)

    Do a clean reinstall and download a fresh Firefox copy from http://www.mozilla.com/firefox/all.html and save the file to the desktop.
    Uninstall your current Firefox version and remove the Firefox program folder before installing that copy of the Firefox installer.
    It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    You can skip the step to create a new profile, that is not necessary for this issue.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • How to create a variant to a report from another program at run time

    Hi experts,
                   when i am using FM  :  /OSP/REPORT_CREATE_VARIANT to create a report variant from a program then i am getting  an error 'For object /OSP/ERPNR , number range interval 01 does not exist ', how should i avoid it or can any one help me out to create a report variant from another program at run time with the results of the program.so that i can execute the report from here with this variant

    If i understand you,
    - You can use a FM like [RS_CREATE_VARIANT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=rs_create_variant+&adv=false&sortby=cm_rnd_rankvalue] to create a variant and then use it in the [SUBMIT|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096d67543b11d1898e0000e8322d00/frameset.htm] statement USING SELECTION-SET.
    - But you may also use SUBMIT with WITH parameters which doesnt require variant creation and with much less programming efforts.
    - You can mix the two solutions also.
    So what is you actual requirement, also look at some documentation like [ Scheduling a Job: Full-Control Method|http://help.sap.com/erp2005_ehp_03/helpdata/EN/fa/096ce5543b11d1898e0000e8322d00/frameset.htm]
    Regards

  • [OLAP DML] display on screen the output while the program is running

    Hi,
    I'm running a script in AWM that is quite long, and I've placed some few 'show' so that I know what the program is doing, but it won't show on the screen the outputs until the program ends. I guess it writes all the outputs in a kind of buffer and release the content of the buffer at the end of the program.
    How could I have it to release this buffer continuously?
    Thanks

    i think the relational analogy would be an anonymous pl/sql block executing a list of commands while outputting a list of useful dbms_output.put_line log statements:
    Just as with SHOW and olap worksheet cmd line, you cant see the running dbms_output log while the pl/sql program is running... you need to wait for it to complete before you can see the log.
    You can write to a file and close/exit the file each time or you can write to log table and commit each time but i guess, some such heavy lifting is needed if you want to track the long running process mid-way.
    NOTE: For regular operations like dbms_cube.build load/forecast/allocate process/steps, you can always run queries against CUBE_BUILD_LOG etc mid-way. But if it's pure olap dml actions being performed then no neat pre-built handle to check things mid-way exists.

  • ParticleFilter4 parameter error while program running

        I use CVI and VDM8.6, I had installed the VDM8.6 patch package, and there is no error while  program compile, but when run the program, there is error occured, the error message is as attached image showed;
        also I had another question: should I place ParticleFilter() before ParticleCount() or after ParticleCount?
    Thanks in advance,
    Solved!
    Go to Solution.
    Attachments:
    Particlefilter_runerror.JPG ‏63 KB

    Dear Guenter,
        Problem solved, Thank you very much!
        I made mistake on  the input  pointe parameter, when the pointer is used as output parameter then it no need to assign memory.
    Sam Liu

  • Can i edit my program while the program is running?

    With some programming languages you can pause the program while it's running, make a change to it and continue. This feature would be very usefull to me. Does anyone know a routine to accomplish this in LabView?
    Thanks
    Dusty

    Hello Dusty,
    I have a program with some filter routines in a library. The user can select one of the filters and process data with it.
    Because of the "call by reference" I can edit those filters while the main vi is running. And I can even add or delete the filters, as the main vi has a "scan" routine to check for new filters... I thought such a mechanism could be helpful to you.
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

Maybe you are looking for

  • Can I use Apple TV with a Netgear NAS

    I've a Netgear Duo NAS connected to my wireless network which has an itunes streaming server built in. My question is will Apple TV pick up the wireless signal and allow me to stream the music to my hifi and TV? I really don't want to leave my comput

  • How can I fix my iPod if it won't load any app?

    My iPod won't load any apps and if it does I will get kicked out of the app within 20 seconds. I've read that I should just try restarting it by holding the home and power button until it shuts off, but my power button is stuck. The other thing I've

  • Zed E-Commerce 7.0.1 Now available

    zedIT Solutions has released it's version of the rebranded and updated Web tools product, version 7.0.1.  This has all the fixes that went into patch 4 for Web tools, updated 3rd party controls, branding, and more. Express Checkout Now shoppers can c

  • Is it the power supply... or the motherboard?

    Lets start of with specs...     K7T266 Pro2 Mainboard     AMD Athlon XP 1700+     nVidia GeForce 3 Ti 500     Creative Labs Audigy MP3     Western Digital 80 GB Hard Drive (7200RPM)     IBM 40 GB Hard Drive (7200RPM) Mmkay now... I just installed som

  • My z1 will not charge

    Dear all, since last night I have been having major trouble with my z1. The phone died completely last night and when I plugged it into the mains, there was a red light that flashed a few times then stopped. I left it for a little while but there was