Restarting your program?

Hi, I get to the end of my window application and I want it to restart when you click on the button. I have the button set up so thats not a problem. But what is the code I need for restartng the application?

k, no its not final. and sry but for u to have an idea this is gonna be a large piece of code:
//Pass the String numberOne & numberTwo into the integers numOne & numTwo
          int numOne = Integer.parseInt(numberOne);
          int numTwo = Integer.parseInt(numberTwo);
          //Reset Button
          JButton reset = new JButton("New Calculation");
          int answer = 0;
          //Output the answer (check the operator)
          if (operator.equals("+")) {
          answer  = numOne + numTwo;
          if (operator.equals("*")) {
          answer  = numOne * numTwo;
          if (operator.equals("-")) {
          answer  = numOne - numTwo;
          if (operator.equals("/")) {
          answer  = numOne / numTwo;
          //Answer Label
        JLabel answerLabel = new JLabel("Answer: " + answer);
        //Set up the content pane.
        Container contentPane = window.getContentPane();
        SpringLayout layout = new SpringLayout();
        contentPane.setLayout(layout);
        //Add the labels to the frame
        contentPane.add(answerLabel);
        contentPane.add(reset);
        //Listener for the reset button
        reset.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
        int answer = 0;
        //System.out.println("You clicked the Button!");
        String numberOne = JOptionPane.showInputDialog(null, "Enter First Number:",
                                        "JCalculator", JOptionPane.WARNING_MESSAGE);
          String operator = JOptionPane.showInputDialog(null,
          "Enter Operator\n+ = Additon \n - = Substraction \n * = Multiplication \n / = Division",
                                        "JCalculator", JOptionPane.WARNING_MESSAGE);
          String numberTwo = JOptionPane.showInputDialog(null, "Enter Second Number:",
                                        "JCalculator", JOptionPane.WARNING_MESSAGE);
          //Pass the String numberOne & numberTwo into the integers numOne & numTwo
          int numOne = Integer.parseInt(numberOne);
          int numTwo = Integer.parseInt(numberTwo);
          //Reset Button
          JButton reset = new JButton("New Calculation");
          //Output the answer (check the operator)
          if (operator.equals("+")) {
          answer  = numOne + numTwo;
          if (operator.equals("*")) {
          answer  = numOne * numTwo;
          if (operator.equals("-")) {
          answer  = numOne - numTwo;
          if (operator.equals("/")) {
          answer  = numOne / numTwo;
          //Answer Label
        JLabel answerLabel = new JLabel("Answer: " + answer);
        });

Similar Messages

  • When I start mozilla firefox web browser, sometimes I see a message saying that "a Mozilla Firefox is already running, please close it or restart your program", while I don't have one running at that time. What is the problem?

    When I start mozilla firefox web browser, sometimes I see a message saying that "a Mozilla Firefox is already running, please close it or restart your system". As a matter of fact, there is no firefox browser running at that time. Since I cannot do anything about it, I have to restart my computer before I can use the web browser, which bothers me dearly. What is the problem?

    Plug-in and tasks started by Firefox may continue after attempting to close Firefox. The "X" in the upper right-hand corner closes the Window (same as Ctrl+Shift+W) but even if it is the last Firefox window, it does not necessarily close Firefox .
    '''The only proper way to exit Firefox is to use Exit through the File menu''', not the "X" in the upper right corner of last Firefox window.
    ''Menus hidden: then use Alt+F then X.''
    '''Firefox hangs''' | Troubleshooting | Firefox Support ''(some extensions cause a problem)''
    * http://support.mozilla.com/kb/Firefox%20hangs#w_hang-at-exit
    Use the '''Windows Task Manger''' to remove all running firefox.exe in the "Processes"
    tab of the Windows Task Manager, then restart Firefox.
    "'''Restartless Restart'''" extension for Firefox 4.0 only (2 KB download )
    * https://addons.mozilla.org/firefox/addon/249342/
    use to close and restart Firefox after enabling or disabling an extension, switching
    to a new theme, or modifying configuration files, then you don't have to worry
    about delay or have to look in the Task Manager to see if Firefox is closed yet.
    Uses keyboard shortcut "'''Ctrl+Alt+R'''" or a file menu option.
    '''Windows 7''' users can use '''Ctrl+Shift+Esc''' to get to the Windows Task Manager quicker than starting with Ctrl+Alt+Del.

  • Why does Firefox give this message when I do not have another program running "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

    Question
    why does Firefox give this message when I do not have another program running or another window open - "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." edit

    See also "Hang at exit":
    *http://kb.mozillazine.org/Firefox_hangs
    *https://support.mozilla.com/kb/Firefox+hangs

  • Firefox is OPEN and working fine, but when I click a link in Thunderbird I get 'Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.'

    If I click a link on my desktop or in any other program (while Firefox is open and running), I get this message: "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." There's about a billion links for this if you Google it, but they all say that Firefox wasn't shut down properly. (OK, maybe not ALL of them, but if the needle is in that haystack, I haven't yet found it.) That's not the issue in my case since I haven't shut FF down at all.
    == This happened ==
    Every time Firefox opened
    == IDK

    This began to happen to me when I tried to run two separate profiles simultaneously on the same installation of firefox with -no-remote

  • I try to launch firefox get the following message "firefox is already running, but is not resonding. to open a new window, you must first close the existing firefox process, or restart your system" firefox is not running and restart doesn't work

    when I launch firefox get the following message "firefox is already running, but is not resonding. to open a new window, you must first close the existing firefox process, or restart your system" firefox not running and a restart doesn't solve the problem

    Download a fresh Firefox copy and save the file to the desktop.
    *Firefox 12.0.x: http://www.mozilla.org/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible.
    *Do NOT remove personal data when you uninstall your current Firefox version, because all profile folders will be removed and you will also lose your personal data like bookmarks and passwords from profiles of other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded 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.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    See also:
    *https://support.mozilla.org/kb/Firefox+is+already+running+but+is+not+responding
    *http://kb.mozillazine.org/Profile_in_use
    *http://kb.mozillazine.org/Recovering_a_missing_profile

  • Iget this when I try to open a session....Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.task mngr shows no open firefox processes.

    I get this when I try to open a session....Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.The task manager shows no open Firefox processes.I had two users on this laptop running Firefox and I tried deleting the program on both users. I then downloaded the newest version, installed it and I still get the error message as before. HELP!!!! I loved the browser program when it was working before and would rather use it than other browsers.

    See "Hang at exit":
    * http://kb.mozillazine.org/Firefox_hangs
    * https://support.mozilla.com/kb/Firefox+hangs

  • Sometimes when I close Firefox and try to open it in few moments it shows me message "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." However, I haven't o

    Sometimes when I close Firefox and try to open it in few moments it shows me message "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system." However, I haven't opened any additional Firefox related programs, and previous Firefox is closed. First I though it is because of my computer, but then I discovered that other people have the same problem as well
    == This happened ==
    A few times a week
    == some 2 month ago ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729)

    Hi Andis.
    First of all, this is completely normal behavior, although it's a bit irritating, I know. What happens is that when you close Firefox, despite the window disappearing right there and then, Firefox keeps running for a little bit until the whole closing procedure is completed. This can take a fraction of a second on fast computers, or can take a few seconds on slow computers or when Firefox is storing a large session (if you save your tabs). All you have to do is wait a bit until Firefox closes, and then open it again.
    To see if it's still running, you can press CTRL+SHIFT+ESC and then, under the Processes tab, you can see if firefox.exe is still there. If it's taking an unusual amount of time to close (which happens very rarely, and only if the browser freezes on exit), you can force the application to terminate from this application (task manager).
    Firefox 4.0 will reduce by 97% the time it takes firefox.exe to close, so this problem will be basically erased for Firefox's next version.
    Until then, I can recommend you this extension, which helps you restart your browser more easily and without bothering about closing times:
    https://addons.mozilla.org/en-US/firefox/addon/3559/
    Hopefully this will help.

  • Did anyone else have a 'you must restart your computer' screen today?

    I leave my imac on 24/7. This am, I switched from my wifes user profile to miine, checked my email, got done, closed mail, and was going to open my browser (firefox) and the screen dimmed (like before going to screen saver) and then a gray message box about 3" X 4" with the circular power icon image in light gray background came on in the center of the screen, saying "You must restart your computer-please hold down your power button until computer shuts down (paraphrased). Nothing was going to allow me to do anything else (no cursor movement with the mouse, esc did nothing)so I powered down, and let it restart. Seems ok, I just want to know if anyone else has ever seen or experienced this happening. What entity would facilitate this restart? Apple? My ISP? Some spyware?

    OK....I used the 'maintenance' utility, and ran scripts, repaired permissions, etc. When my computer restarted, I went to my wifes profile, ran 'disk utility' to repair permissions on her profile. Then I opened her browser and cleared her data, ie search cache, website cache, everything except her logon data. When that was done, I went back to my profile, and opened the browser. I'm at that point now, and all seems to be well. But then it seemed well when this first occured. Any guesses as to why this happened or what might have caused it to happen? A program conflict? A visit to a data-mining webpage? I know that some will tell you (or me) that macs are supposedly immune to viral or malware attacks, but there also are those who will argue that it is impossible to protect any computer, even a mac, from all infections. So, part curiosity and part pessimism create a curiosity. Any input would help.
    Thanks.

  • I have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    i have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    Hi
    Did You ever use - iPhoto ?
    Did You may be direct iPhoto to a different Photo Library
    As iMovie tries to find the appropriate photo library - it can get lost if iPhoto direct it into a Library on a not connected external hard disk or to a strange location - And iMovie HANGS.
    Do - When no other program is running that might interfere
    • Start iPhoto - BUT NOW KEEP alt-key (option key) DOWN during the full Start-Up process
    • Now iPhoto let's You select Photo Library
    • Select the one in Your Account / Home folder / Pictures ! !
    • Then iPhoto should start up OK
    • Now Quit iPhoto
    • START iMovie
    Does it still hangs - then I would suspect - iMovie Pref. file
    If it Run's OK - Then HURRAY !
    Yours Bengt W

  • NImax.exe has generated errors. You must restart the program, a log file is being created.

    NImax.exe has generated errors. You must restart the program, a log file is
    being created.
    This error occurs just after bootup, no programs started except windows..
    Running Windows 2000 latest version on a brand new computer.
    (pent 4 3.0 ghz 500MB ram).
    Can anyone help me with this problem? Happened after install Labview 7.0
    express. Installed twice and same problem occured with both installs.
    Labview 7.0 is the only thing installed right now. Also selected "Visual
    Basic Support" install from driver cd's.
    One other thing I just noticed. System info reports 2 processors and I
    think I only have one.
    TIA

    Happy update.
    After ignoring this problem for awhile and installing some NI DAQ boards,
    this problem is not happening anymore.
    Would urge NI to investigate further though. Messed me up for a couple of
    days, and still don't know why it happened.
    Much thanks to those who helped.
    JJ
    "JJF" wrote in message
    news:qB6Hb.48702$VB2.90660@attbi_s51...
    > One other point, I found out this is a message generated by drwtsn32. Can
    > get rid of the error by unchecking "show visual feedback on errors" box,
    but
    > don't like that fix. Still need help.
    >
    > Thanks,
    >
    > JJ
    >
    > "JJF" wrote in message
    > news:%JRGb.138921$8y1.419649@attbi_s52...
    > > Hi Nirmal and all,
    > >
    > > Happy Holidays to you too, and thanks for the reply.
    > >
    > > Making progress. Did all the uninstalling and registry editing as you
    > > suggested. Also, updated Win2K at Microsoft.com as suggested.
    > > Re-installed with default settings of LV express 7.0. Now I only get
    > the
    > > error when I exit NImax.
    > >
    > > Also, my p2p home network is not that hot. Have it set up as a
    workgroup.
    > > Sometimes when I boot up I have file access between the two computers
    and
    > > sometimes windows explorer can't find the workgroup network path
    (between
    > > the two computers). Both computers can always access the internet
    though.
    > > Using a 4 port Linksys cable/dsl router on a cable modem. Using XP
    home
    > > edition on base computer (the one set up for the isp) and Win2K on the
    > other
    > > computer.
    > >
    > > Also, any idea where this log file is going? Thought it was part of the
    > > event viewer but the errors in the event viewer don't seem to correspond
    > to
    > > the NImax.exe logging event now. There is a file in
    > > "winnt\sytem32\config\software.log" that seems to change at about the
    same
    > > time but I can't access the file because it is in use by the system.
    > >
    > > Using NImax ver 3.02.3005. Do you know if I can download "NI
    measurement
    > > and automation explorer" and/or the driver cd's from NI.com? Maybe I
    have
    > a
    > > flaky disk or something. I have a feeling it may also have to do with
    the
    > > "on again/off again" network neighborhood connection problem.
    > >
    > >
    > > Thanks again,
    > >
    > > JJ
    > >
    > >
    > >
    > > "Nirmal Sharma" wrote in message
    > > news:506500000005000000AE470100-1068850981000@exch​ange.ni.com...
    > > > Hi,
    > > > Happy cristmas & new year for you & ur brand new pc...
    > > >
    > > > How are you uninstalling & then installing LV in your pc ?
    > > >
    > > > I suggest to remove complete LV (Remove All option) from your
    > > > computer. Once uninstallation is completed, go to windows registry -
    > > > by windows start -> run -> regedit -> Enter
    > > >
    > > > Goto HKEY_LOCAL_MACHINE-> SOFTWARE -> National Instruments - Delete
    > > > this folder (National Instruments folder)
    > > >
    > > > Remove any other foloder/file related to NI's software. Be very
    > > > cautious while deleting files from windows registry bcoz wrong file
    > > > deletion may hang your whole system.
    > > >
    > > > Restart your computer..hope it should bootup without any errors.
    > > >
    > > > Now as answered by Alexander, update windows.
    > > >
    > > > After updating, bootup your system. If it boots up without any error
    > > > message, install LV with the typical (default installation).
    > > >
    > > > Hope this helps. Your feedbacks are welcome.
    > > >
    > > > Best Regards,
    > > > Nirmal Sharma
    > > > India
    > >
    > >
    >
    >

  • MacBook Air '11 - Grey Power Button with "You have to restart your computer." message. I reopened it and looked @ the details and it said panic and then a bunch of code.

    Basically I was playing my  game and running Skype, talking to friends and the display flickered and then a grey box with a power button and a message that said "You have to restart your computer." It booted up fine, then I looked at the details and it said something about a panic report and the one program it mentioned was Skype. I haven't downloaded anything off of Skype. I'm scared because I just got this computer as a gift and I don't know what to do and I don't want to make it worse. It's been about 15 minutes and it seems to be running fine. I haven't started up Skype again.

    Read about Kernel Panics here: http://support.apple.com/kb/TS3742
    Most are the result of conflicting hardware drivers or faulty memory, but in your case it seems Skype may have been the culprit. Make sure you are using its latest version.

  • Please restart your computer or verify your Compressor installation is corr

    Please restart your computer or verify your Compressor installation is correct. - That's what it says every time I try to compress anything, it was working but after installing new programs I think it messed it up. Anyone help me?

    This is how I fixed it:
    http://discussions.apple.com/message.jspa?messageID=6246491#6246491
    It seems like qmasterd just needs a kick-start. All I had to do, was to start the qmasterd using a few simple Terminal commands. That made SystemStarter start qmasterd on startup of OS X again.
    If my suggestion does not work, have a look at Matthew Judy's solution linked to in the same thread.
    Good luck!

  • Restart your computer by holding the power......

    This morning i was fooling around with a /usr/local file, i accidently deleted it and the computer stopped responding, so i held the power button for a few seconds and the computer turned off. Upon pressing it again, the apple logo appeared, followed by a black screen with a black box inside it saying restart your computer by holding the power button for a few seconds... so i did that, and restarted the computer.. Nothing, the same box appeared again, Kept trying and trying..
    Please help me identify the problem and solution. Thanks

    Just recently I tried to upgrade my vuze and install limewire and upon installation I suddenly get a gray tint come down over the screen and a multi language message that says 'you need ot restart your computer. hold down the power button for several seconds or press the restart button'. the only way out of this screen is to, as it tells me hold down the power button and stress out my computer. can someone help? I have read up on a similar problem that happens to people at start up but this is particular to these two programs only for me so far...

  • How to restart a program that has already started?

    On my previous cable TV system, I could restart a program after it had already started all the way back to the beginning, to see the whole program. How can I do this with FIOS?
    Thanks.

    tns wrote:
    I had only heard that Cablevision was doing this with its Virtual DVR.
    Essentially with Verizon FIOS you can only restart on a DVR what the DVR has in its buffer.  If it one of the tuners happened to be tuned to that station (even if the DVR was off), you can backup to the beginning of the program if its still in the buffer.  One way to see if this is possible, without rewinding, is to hit record, then look in your DVR recordings and select the program.
    Some days later you might find a program in the VOD section.  For some channels, e.g. movie channels, it may be already in VOD. 
    No. I don't mean with the DVR. Let's say I turn on a program at 9:17PM but it started at 9 PM. Is there a way I can re-start the program so I can watch it from the beginning? My cable company had a way to do this. Does FIOS?

  • IMac G3 Kernel Panic - You need to restart your computer - HELP

    I have an iMac G3 400Mhz slot-loading with 256MB 13GB running Mac OS 10.3.3. It was all along running Ok until I tried to do an OS updating recently. After update done, re-boot and I got this cyclic message "You need to restart your computer". Tried all methods like pressing CtrlOption+PR or Option during power-up but still the same. Now at a loss as I also cannot find my OS media installation CD anymore. Can anyone suggest how to remedy this? Worse case scenario, I don't mind clean re-load OS but need help in getting a copy of the Mac OS installation media.

    Welcome To  Discussions KevK!
    How much space is available on the 13 GB Hard Drive?
    What peripherals do you have connected to the iBook?
    Are there any programs or applications, that are set to load at Startup?
    You may find use helpful tips in this document Resolving Kernel Panics, authored by Dr Smoke.
    As the iMac G3 400 MHZ's, original pre-installed OS was Mac OS 8.6, the original system discs, will not be much help.
    You will need to purchase a new set of Panther discs, or a newer version of OS X, if you wish to upgrade.
    With a larger Hard Drive, and additional RAM, that iMac, is capable of running Tiger 10.4.x.
    Tiger is available for purchase at The Apple Store (U.S.).
    Panther, is no longer available directly from the Apple Online Store, as Leopard 10.5.x, is the most up to date OS.
    But, if you know what to look for, a Full Retail Version, of the Panther Install CDs, or a Full Retail Version, of the Tiger Install DVD, can be purchased, sometimes less expensively, at some online Apple retailers, Amazon, eBay, FastMac, HardCore Mac, AllMac, etc.
    Be sure not to purchase grey, upgrade or machine specific CDs or DVDs.
    Panther is only on CDs, not DVDs.
    The discs should look exactly like the images in the above links, and not say Upgrade, CPU Drop-in DVD, or "This software is part of a hardware bundle purchase - not to be sold seperately." on them.
    Additional info in these links.
    Using OS X Install CDs/DVDs On Multiple Macs
    What's A Computer Specific Mac OS X Release
    Software Update, Upgrade: What's The Difference?
    Caveat Emptor!
    If any are presently available, examine these items very carefully, and if in doubt, ask questions of the seller before purchase!
    Panther On eBay
    Tiger On eBay
    Once Panther 10.3.x is re-installed, you can use the 10.3.9 Combo Update, to upgrade to the final version.
    If your Mac meets the Tiger System Requirements, you could also consider installing that, and then use the PPC 10.4.11 Combo Update, to upgrade to the current version.
    Additionally, Tiger 10.4.x ships on a DVD, so if your Mac doesn’t have a built-in DVD-ROM player, you will have to use an alternative method of installation.
    Info here Installing Tiger Using Firewire Target Disk Mode.
    And here Installing Tiger Without A DVD Drive.
    The Tiger Media Exchange Program, referred to, is no longer available.
    Shop Carefully, Examine All Documentation, And I Wish You Success!
    ali b

Maybe you are looking for

  • New to Solaris - Installing on Blade 100, Various Issues

    I have recently purchased a Blade 100 to use as a workstation/server/faffing-about machine to basically learn how Solaris works! After working out all the different editions, I downloaded b76 for SPARC and installed. As I don't have enough RAM (yet)

  • Best practise, do you store your files in the Filesystem, too?

    I hope you can answer my question? For three weeks we have all the objects in the Repository | | and on the filesystem. We have mapped the repository to the filesystem. Does that makes sense? Or should we delete all the data from the filesystem so th

  • How do I get pictures off my ipod

    I have an older Ipod and I want to get the pictures off of it? I've tried looking at my computer when it's connected but I see nothing in any of the folders. What should I try next?

  • Score editor: Two staves instruments, etc.

    Hi, I' m having several problems when i write for instruments that have two staves (piano, harp,etc.) I' ll try to explain: A) When i write a chord, for example and the notes have the same length, i have no problem but when i have a chord and i try t

  • Samsung s4 status bar issue

    After upgrade tp kit kat I cannot get the status bar to drop down when I swipe it.  Cannot see the notifications