Any idea why the applets starts but nothing works?

I am 1 month old. Here is small training program that I am trying. Any idea why the applet is running but nothing works?
thanks
package javaapplication1;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.event.*;
import javax.swing.*;
public class MoneyCollect extends JApplet implements ActionListener {
private JLabel promt;
private JTextField input;
private int total;
    public void main(String [] args){
        Container c = getContentPane();
        c.setLayout( new FlowLayout() );
        promt = new JLabel ("Enter number of hours");
        input = new JTextField (10);
        input.addActionListener(this);
        c.add(promt);
        c.add(input);
    public int calculateCharges(int hrs){
        if ( (hrs>=0) && (hrs<=3) && (hrs != 24) ){
        total = 2*hrs;   
        if((hrs>=3)&& (hrs<24) && (hrs != 24)){
        total = (int) (((hrs - 3) * 0.50) + 6);
        if (hrs == 24){
            total = 10;
        return total;
    public void actionPerformed(ActionEvent e) {
        int hrs = Integer.parseInt(e.getActionCommand());
        showStatus ("You have to pay:"+calculateCharges(hrs));
}

...because changing this:
public class MoneyCollect extends JFrameto this:
public class MoneyCollect extends JAppletdoes not create an applet. Get a beginning java book and start reading it. I recommend "Java2: A Beginner's Guide".
Or, you can read the following tutorial to learn why your program is not an applet:
[http://java.sun.com/docs/books/tutorial/deployment/applet/getStarted.html]

Similar Messages

  • TS3694 My iphone 4 has died and says connect to itunes.  itunes restore wont work, error message 2001, then 2006 appears.  Tried all the troubleshooting help, but nothing works.  Any ideas???

    My iphone 4 has died and says connect to itunes.  itunes restore wont work, error message 2001, then 2006 appears.Tried all the troubleshooting help, but nothing works. Any ideas???

    I solved my own problem. Hopefully this will help someone else.
    I did a DFU restore, then started it up as a new phone on iTunes. Everything loaded properly, then from iTunes did a restore from backup, selected the one I wanted and it still took me to the same screen with 3 options of restore. I chose the start up as new phone from the actual phone and after all the syncing was completed, my phone is back in working order.

  • I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

  • I have Creative Cloud and just downloaded Ae... but it is version CS6... not CC2014.1 . Any idea why the download is for an older version?

    I have Creative Cloud and just downloaded Ae... but it is version CS6... not CC2014.1 . Any idea why the download is for an older version?

    If there are problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the disk image (dmg) file to the desktop
    * Firefox 7.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data if you uninstall and (re)install Firefox.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Any ideas why the sound only works on about half of my apps?

    Any ideas why the sound on my ipad only works on about half of my apps?

    The problem of tracks becoming de-linked between iTunes and the music files in your iTunes music folder happens for different reasons - this seems to come up fairly commonly in this forum.
    The solution can be to locate each song in the iTunes library, as you mentioned - or, but wait, before I get to that...
    trouble finding the original track in your iTunes music folder? maybe look for it under compilations, or if not using the 'group compilations preference' then look in the folder under the songs artist name, but what song artist name iTunes uses depends on what you have in the metedata tag spot for album artist or song artist. Any varyation in artist name spelling, in the menu item 'get info' metadata for any selected individual track will cause iTunes to create that as a separate artist folder in the library, even names like 'various' or any difference at all (even the word 'the' can change where in your iTunes music folder a track gets placed by iTunes). You can try to use the finder function of find file (finder munu item outside of iTunes) to locate hard to find items.
    Back to how to re-link any de-linked tracks .
    There may be scripts that can help re-link de-linked music files - or, at least provide you a list of such files, Scripts are easy to install and use...
    at Dougs Scripts, there is one called iTunes Track CPR that might work
    http://dougscripts.com/itunes/scripts/ss.php?sp=itunestrackcpr
    or, if you just want a list of de-linked tracks, go to
    http://dougscripts.com/itunes/
    and find the script called List MIA's, this will create a text file listing all de-linked tracks
    if you review the thread at
    https://discussions.apple.com/thread/3633708
    also the thread at
    https://discussions.apple.com/message/17513078#17513078
    you may find more insight into dealing with this kind of issue there, although some of that thread may not apply to your case, aspects of it might help.
    Good luck.

  • Any ideas why the video camera on my imac is not working?

    Does any one have any idea why the video camera on my imac is not working? I have been using skype on my imac for some time and recently I have discovered that it wont work, could this have anything to do with the mountain lion upgrade?

    Have a look here: http://support.apple.com/kb/HT2090?viewlocale=en_US
    I think I'd start with the SMC reset.

  • HI! any idea why the add videos on apple site are not loading on my computer?

    HI! any idea why the add videos on apple site are not loading on my computer?

    You may have something as simple as a corrupt cache. Try resetting in Safe Mode and see if that fixes it. If not another thing to attempt is opening Disk Utility and Repairing Disk Permissions, do this action 2-3 times.

  • I can connect my Iphone 6 and Ipad Air to my Bose Soundlink but not my IMac.  I have tried all the usual solutions but nothing works.  It has worked recently but not in the last week. Help

    I can connect my Iphone 6 and Ipad Air to my Bose Soundlink but not my IMac.  I have tried all the usual solutions but nothing works.  It has worked recently but not in the last week. Help

    make sure it's not being connected to by any of the other two
    one can only connect 1 device at the time and just by waking up sometimes a headset connects to a device
    automaticly
    then forget the bluetooth device in OS X and put the headset in pairing mode / discovery mode and connect with it once again with the mac

  • I can't get my iMac to accept a CD/DVD disc.  It acts like there's already one in there but there isn't.  Tried the help menu but nothing worked.Suggestions?

    I can't get my iMac to accept a CD/DVD disc.  It acts like there's already one in there but there isn't.  Tried the help menu but nothing worked.Suggestions?

    Thank you, Allen.  My iMac is a 2009.  I can't shine a light into the disc drive slot as it has a built in whisker cover that prevents anything from getting in.  It will accept a disc half way in before the disc reaches a springy obstruction.
    About 3 weeks ago, the computer locked up so I inserted the OS disc and reinstalled it.  In general, the computer works just like it used to but we've had a few quirks appear; for example, this is one of them.  Also, we can't figure out how to keep from having to sign-in when we turn the computer on.  Also, we can't access our one on-line account anymore.  Very strange.
    Dave
    P.S.:  Just realized I mis-spelled your name.  Sorry Allan.
    Message was edited by: DTabbert

  • My ipod has a white screen and i cant do nothing i click on the home the volume and the lock botton but nothing work what do i do

    my ipod has a white screen and i cant do nothing i click on the home the volume and the lock botton but nothing work what do i do

    Let the battery fully drain. After charging for an hour try:
    - A reset.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Connect to computer and try to retore.
    - If the screen remains white and you can't trun it off then it is time for an appointment at the Genius Bar of an Apple store. You very likely have a hardware problem.

  • My iphone 4 lock screen/power button is not working, nothing spilled on it and not dropped, any idea why the button won't work?

    My iphone 4 lock screen/power button just stopped working.  nothing spilled on it and not been dropped.  Any idea why it stopped working?

    Kat Goddess wrote:
    Any idea why it stopped working?
    I have no idea why it stopped working.  But why it failed does not matter.
    Take it to an Apple Store or Authorized Apple Repair Center and have it assessed and see what it would take to get it working.

  • HT201317 My Photo Stream has suddenly stopped pushing my photos to my PC though they appear on both my iPhones. Any ideas why or how to make it work again?

    My Photo Stream has suddenly stopped pushing photos from my iPhone 4s to my PC although they are appearing on my other iPhone. Any ideas why or how to fix the issue? I have not altered any settings.

    Hi Kevinmvb,
    Welcome to the Support Communities!
    The article below may be able to help you with this.  It sounds like you may have moved your photos out of the Uploads folder where they need to reside.
    iCloud: My Photo Stream troubleshooting
    http://support.apple.com/kb/TS3989
    Cheers,
    - Judy

  • I am trying to download Photoshop on my mac, the site says the download started but nothing happens...

    I am trying to install the CC on my Mac because my desktop computer died on me. I logged in, selected photoshop ( or premiere, or after effects) and hit the download button. The site says download in progress but nothing happens. I have downloaded other software ( not adobe) and it worked fine...Any idea what is wrong? I am not a Mac person and I am kind of lost. Thanks!

    Animationix please see Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html for information on how to install the Adobe Creative applications included with your membership.

  • Any idea why the scrabble board will not load in firefox, when it does (on the same machine) in explorer?

    I downloaded Firefox this morning to solve some explorer problems, and made Firefox my default browser. I play Lexulous (scrabble) through gmail, but firefox will not load the actual game board. Any ideas?

    Apple Portables: Troubleshooting the slot load optical disc drive

  • Any idea why the sissor cut tool would behave differently than it has. It makes the cut several seconds in advance of my marker-now. Previously it was precise. Thx..

    The sissor tool is making arbitrary cuts, in areas I have not specified. I have  used this tool alot. Has previously worked as desired.
    Any idea what might be controling it to act this way?
    Thank you.

    Hi
    Snap value set to something like Bar/Beat?
    CCT

Maybe you are looking for

  • Basic question about Flash video. Please Help

    Hello, Sorry for the noob question but I'm struggling with the basic understanding about the Flash video. I just need to reduce a large video file to a small size with a nice quality and the Flash Video Encoder does very god job with that. But when I

  • How to Use CS4 using C#

    Hello guys am new to adobe forum. please help me. am in trouble!!! i  have got one project regarding IN DESIGN. am .net developer, i have downloaded CS4 server free trail. can any one please tell me how to use CS4 using c# ? urgent please.

  • Weird ringing noise when laptop is plugged into AC - HP ENVY 14-2050se Beats Edition Notebook PC

    Hi, last month I bought this HP ENVY 14-2050se Beats Edition Notebook from a nearby electronics store and I loved it from first sight. Except a few problems emerged when I first turned it on at home. First, yes I did a full hp recovery factory restor

  • Magic Moving Keyframes

    hi, i did a quick search and came across one other instance of this but it wasnt answered ( unless I didnt search properly!) I have a parent layer with other layers in it. I keyframe aspects of the parent layer, like size and position etc. works fine

  • Multiple clients in CRM Dev/QA system

    Hi All- I've seen in various places that it is recommended to only have one client in a CRM system. I have worked at many sites that have several CRM clients in a system without issues. Can any one point me to an SAP Note or document that recommends