HOW TO GET THIS OFF?help needed...

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Calculator
public static void main (String [] args)
JFrame frame = new CalculatorFrame ();
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frame.show ();
class CalculatorFrame extends JFrame
JTextField jtf;
JLabel jlb;
JTextField jtf1;
JLabel jlb1;
JTextField jtf2;
JLabel jlb2;
JButton jbt;
JButton jbt1;
JButton jbt2;
JButton jbt3;
public CalculatorFrame ()
setTitle ("SIMPLE CALCULATOR");
Container contentPane = getContentPane ();
contentPane.setLayout(new FlowLayout());
jlb=new JLabel();
jlb.setText("integer1");
contentPane.add(jlb);
jtf=new JTextField(15);
contentPane.add(jtf);
jlb1=new JLabel();
jlb1.setText("integer2");
contentPane.add(jlb1);
jtf1=new JTextField(15);
contentPane.add(jtf1);
jlb2=new JLabel();
jlb2.setText("result");
contentPane.add(jlb2);
jtf2=new JTextField(15);
contentPane.add(jtf2);
JPanel buttonPanel = new JPanel ();
     addButton (buttonPanel, "add",
new ActionListener ()
public void actionPerformed (ActionEvent evt)
     float a=Float.parseFloat(jtf.getText()), b=Float.parseFloat(jtf1.getText()), temp;
     jtf2.setText("");
temp = a+b;
          jtf2.setText("" + temp);
     addButton (buttonPanel, "subtract",
new ActionListener ()
public void actionPerformed (ActionEvent evt)
     float a=Float.parseFloat(jtf.getText()), b=Float.parseFloat(jtf1.getText()), temp;
     jtf2.setText("");
temp = a-b;
          jtf2.setText("" + temp);
     addButton (buttonPanel, "multiply",
new ActionListener ()
public void actionPerformed (ActionEvent evt)
     float a=Float.parseFloat(jtf.getText()), b=Float.parseFloat(jtf1.getText()), temp;
     jtf2.setText("");
temp = a*b;
          jtf2.setText("" + temp);
     addButton (buttonPanel, "divide",
new ActionListener ()
public void actionPerformed (ActionEvent evt)
     float a=Float.parseFloat(jtf.getText()), b=Float.parseFloat(jtf1.getText()), temp;
     jtf2.setText("");
temp = a/b;
          jtf2.setText("" + temp);
addButton (buttonPanel, "Close",
new ActionListener ()
public void actionPerformed (ActionEvent evt)
System.exit (0);
contentPane.add (buttonPanel, BorderLayout.SOUTH);
public void addButton (Container c, String title,
ActionListener listener)
JButton button = new JButton (title);
c.add (button);
button.addActionListener (listener);
when i compile the above program using the below statement
C:\Program Files\Java\jdk1.5.0_14\bin>javac Calculator.java
Note: Calculator.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
but if i run the program i get the output....
for creating a jar file: i followed the following procedure
1.first,i created a mainClass.txt file containing the info
Main-Class: Calculator
2.i used the statement
C:\Program Files\Java\jdk1.5.0_14\bin>jar cmf mainClass.txt Calculator.jar *.class
to create a jar file
3.i had created a Calculator.jar file now..now when i try to execute the jar file by using
C:\Program Files\Java\jdk1.5.0_14\bin>java -jar Calculator.jar
i get the following error
+Exception in thread "main" java.lang.NoClassDefFoundError: Cal
culator+
what should i do to execute my Calculator.jar file?

First, open the jar with something like WinZip and verify the Manifest.mf has the correct info.
Also, verify that the file/dir structure is correct.
Make sure that the mainClass.txt has a carriage return following the "Main-Class: Calculator"
Have just tried this here with JDK6 and it compiles and works as it should.
KC

Similar Messages

  • HT1349 hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    Hi.
    I had a similar problem myself. This is what helped me.
    I went to the App store app, scrolled to the bottom, logged out of the account, re logged in with my Apple ID.  Then went back to app updates. Once I put in my ID password all was fine.

  • HT4528 I accidently put all my pics from my computer onto my phone and i have no idea how to get them off. Can u please help me?

    I accidently put all my pics from my computer onto my phone and I have no idea how to get them off. Can u please help??

    PhilipRoy wrote:
    Please see this article about transferring photos from a mobile device to a computer.
    http://support.apple.com/kb/ht4083
    Good luck Friend.
    That's not going to help.  That article is for moving photos from iOS device to computer, not for removing them.  Additionally, photos synced via iTunes cannot be manually removed from the device.  You have to use iTunes to 'unsync' them, as FoxFifth stated.
    Camera Roll pictures are the only ones that can be imported from device to computer.  Album folders cannot be moved from device to computer.

  • I have a 4s iPhone which I loaded the new Os on last night. Now I can not connect to iTunes. A message comes up saying i need 10.6.3 or later but I am running 10.6.1 as I have an older Mac. Anyone have ideas how to get this to work?

    I have a 4s iPhone which I loaded the new Os on last night. Now I can not connect to iTunes. A message comes up saying i need 10.6.3 or later but I am running 10.6.1 as I have an older Mac. Anyone have ideas how to get this to work?

    Its not telling you to update your iPad, its telling you you need to download a recent version itunes on your computer.
    Go here to download the newest version of iTunes.
    http://www.apple.com/itunes/?cid=OAS-US-DOMAINS-itunes.com

  • Can anyone explain to how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this it is driving me nuts

    can anyone explain to me how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this i want to get rid of it it is driving me nuts

    What do you have checked in Firefox Preferences>General?
    Ciao.

  • Pls. let me know how to get rid off this ribbon?

    Hello
    I am developing an VISITOR Adobe Interactive Form, i have Designer 8.1 and Reader 9.0 in my Windows 7 Laptop. When i checked the menu EDIT-->form properties --> Compatability, its Adobe XML form File (XDP) When i opened this VISITOR interactive form in a browser, right clicking and checked form
    PROPERTIES, then i saw the "PDF Version: 1.6 (Acrobat 7.x)"
    When i executed/run this interactive form, am getting a violet colred ribbon on the top of the form, with a text of "Pls fill out the folowing form. You can save data typed into this form" on left corner "
    But, i do not want to get/display/see this violet ribbon on my form, pls. let me know how t get rid off this robbon?

    I bet if you Google "iPhone error code 1611" you'll get a clue as to how to fix your problem

  • HT1758 I can't seem to turn off my assistant. It talks to me constantly (or on mute) and it goes through each box individually. This makes it difficult to navigate myself through pages. Please, if you know how to turn it off, help.

    I can't seem to turn off my assistant. It talks to me constantly (or on mute) and it goes through each box individually. This makes it difficult to navigate myself through pages. Please, if you know how to turn it off, help.

    In 10.6 or earlier go to: Apple / System Preferences / Universal Access and turn off Voice Over.
    In 10.8 go to: Apple / System Preferences / Accessibility / VoiceOver and uncheck the box for Enable VoiceOver.

  • I m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    i m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    We were able to log in this morning and all is working. You should be able to log in at any point today. Please let us know if you are having any other difficulties.

  • When i open safari an apple alert comes up with a phone number.  when i call i get put on hold forever.  how do i get this off there?

    when i open safari an apple alert comes up with a phone number to call.  when i call i get put on hold forever or no one calls me back.  how do i get this off there and what is it?

    It's a scam. Do not call the number. There are several ways to recover.
    1. Some of those scam pages can be dismissed very easily. Press the key combination command-W to close the tab or window. A huge box will pop up. Press the return key and both the box and the page will close. If that doesn't happen, continue.
    2. Press and hold command-W. You may hear repeating alert sounds. While holding the keys, click the OK button in the popup. A different popup may appear, which you can cancel out of as usual.
    3. From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Security
    and uncheck the box marked Enable JavaScript. Leave the preferences dialog open.
    Close the malicious window or tab.
    Re-enable JavaScript and close the preferences dialog.
    4. If the Preferences menu item is grayed out, quit Safari. Force quit if necessary. Relaunch it by holding down the shift key and clicking its icon in the Dock. None of the windows and tabs will reopen.
    After closing the malicious page, from the menu bar, select
              Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    to get rid of any cookies or other data left by the server. Open your Downloads folder and delete anything you don't recognize.

  • I just got my iphone 5c ...went to the apps store and started a new id...its stuck on the privacy policy and i dont know how to get it off that ...please help

    I just got my iphone 5c ...went to the apps store and started a new id...its stuck on the privacy policy and i dont know how to get it off that ...please help

    Hi Bam,
    I am so ecstatic to hear that you are wanting to open an account in your name! We offer an Assumption of Liability that would allow you the current account holder to give permission for you assume liability of your number. Click here for information on how the process works http://vz.to/HverXe .
    Thanks,
    PamelaF_VZW
    Tweet us @vzwsupport

  • Blue cirlce with the letter i in it , how do I get this off , cos can't get wi fi

    Blue circle with i in it , plz someone tell me how to get it off , no wi- fi on

    Hi de santis agency,
    Please follow the link mentioned below:
    Hide Welcome screen | Acrobat, Reader X | Windows

  • A friend of my daughter's used my mac when she got her new iphone.  Now I have a new iphone and my phone has her app store information on it and I don't know how to get it off and put mine in there!

    A friend of my daughter's used my mac computer when she got her new iphone to help set it up.  Now that I have a new iphone, her apps and all the app store information is stuck on my phone.  Her app account keeps showing up when I try to install something new, and I obviously do not have her password.  How do I get this off my phone??

    Open iTunes on the computer.  Without any iPhone plugged in, go to iTunes' menu and do Store > Sign Out.
    The click the iTunes Store row on the left of the iTunes display.  You can then sign on from the signon row on the right side of the display using the correct Apple ID and password.  Then you'll be all set!

  • I have an old ipod and want to know how to get everything off it and into my iTunes library.  My old computer died and the original library was lost, so don't have any of the content saved anywhere else.

    I have an old ipod (it's the very thin oblong one in purple, the one before the one that does video) and want to know how to get everything off it and into my iTunes library.  My old computer died and the original library was lost, so don't have any of the content saved anywhere else.  I now have an iPhone 5S and listen to music on that, so want to be able to listen to things from the old ipod too.
    Can anyone help please?
    Thanks very much
    Jane

    Apple normally does not get involved in handling lost objects like this.  Since a real name is not installed it will be much more difficult.
    You can try contacting Apple support at the US number, assume you are US going to BWI from the listing: http://support.apple.com/kb/HE57 and explain the situation and see if they offer any suggestions.

  • HT4929 I have (or had?) 2 alias  I followed the instructions to go from MobileMe to iCloud. But the alias stayed on MobileMe server (?) How to get this to iCloud?

    I have (or had?) 2 alias My main account is on iCloud. I followed the instructions to go from MobileMe to iCloud. But the alias stayed on MobileMe server (?) How to get this to iCloud? Not possible to put them into icloud as alias. How to keep  it working?HELP HELP because people sending me things to this email and since today no excess any more to the mobile me server? And how to move this?????
    <Emails Edited by Host>

    Firstly, I note that your profile states that you are using OS X 10.5.8, in order to use iCloud on your computer you need OS X 10.7.2 or better.
    Secondly, I have asked for your email address to be edited out. Post your address in an open thread is a sure way to be bombarded by unwanted email, remember it will be here long after you have resolved your problem, for automated detection software to find.
    If you want people to contact you, enable others to see your email address in your profile.
    Finally, are you sure that these additional addresses are aliases and not sub accounts on a family pack, aliases from MobileMe should transfer to an iCloud when you migrate.

  • Customized the upper area now can't read tabs or get it off help

    customized the top of the screen to a Thanksgiving theme
    can't read my tabs through it
    don't know how to get it off and change back to original

    You have installed either a Theme or a Persona.
    To return to the "Default",
    #do one of the following
    #*click Firefox button > Add-ons > Appearance
    #*tap the ALT key, click Tools > Add-ons > Appearance
    #*Hold down the ALT key while pressing the keyboard letters T A, release the ALT key, then click Appearance
    #then choose "Default"
    #then click "Use Theme"
    #then close the Add-ons window/tab
    See --> [http://support.mozilla.com/en-US/kb/Using%20themes%20with%20Firefox#w_managing-themes-and-personas Managing themes and personas]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

Maybe you are looking for

  • Need some help with error

    I am taking a course in Java and am getting an error in my code-Can anyone help? I would appreciate it! When I compile I get- C:\IST265 Java\lesson2\GFH2_1.java:23: ')' expected ^ 1 error Tool completed with exit code 1 My code is //Convert fahrenhei

  • Does mountain lion support airplay mirroring

    I am trying to get netflix on apple TV and have had 2 stories aout airplay. 1 is you cannot use airplay from the imac outside the itune app if you have a core dual processor? Secondly you need mountain lion to use airplay outside of itunes. Reason be

  • How to use Parental Contro; on Yosemite ?

    I want use parental control for the first time on new install Yosemite. How to do it. help is not available ?

  • How to add a contact in the latest Skype?

    How do i add a contact in skype if i only have skype identity/name? When i click on add contact then i get a window which asking for email, phone etc to add the contact.BUT i DONT have email for the friend , i just have his skype user name/idendity w

  • Cannot sync iCal and Address Book to iPod

    I have an iBook and a 30g video iPod. I have plenty of contacts in my Apple address book and plenty of info in iCal, but when I try to load them onto my iPod, it says I must ADD contacts and calendars. It doesn't seem to recognize my contacts and my