I copied this from a book and it doesn't work!!! HELP!!!!

import java.awt.FlowLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
public class FrameButton extends JFrame
     private JButton plainJButton;
     private JButton fancyJButton;
     public FrameButton ()
          super( "Testing Buttons" );
          setLayout( new FlowLayout() );
          plainJButton = new JButton( "Plain Button" );
          add( plainJButton );
          Icon smile2 = new ImageIcon( getClass().getResource( "smile2.gif" ));
          Icon smile4 = new ImageIcon( getClass().getResource( "smile4.gif" ));
          fancyJButton = new JButton( "Fancy Button", smile4 );
          fancyJButton.setRolloverIcon( smile4 );
          add(fancyJButton );
          ButtonHandler handler = new ButtonHandler();
          fancyJButton.addActionListener( handler );
          plainJButton.addActionListener( handler );
     private class ButtonHandler implements ActionListener
          public void actionPerformed( ActionEvent event )
               JOptionPane.showMessageDialog( FrameButton.this, String.format(
                    "You pressed: %s", event.getActionCommand() ) );
i get the following error:
cannot find symbol method format(java.lang.String.java.lang.String)

Check the JCreator help for using different JDKs. I have no idea about JC.
And run it from command line and see if 1.5 is installed properly.

Similar Messages

  • I bought an ipod in 2006 and used it only for a few days, and i lost it when it fell two times from my hand and it wasn`t working, help me regarding this.

    i bought an ipod in 2006 and used it only for a few days, and i lost it when it fell two times from my hand and it wasn`t working, help me regarding this.
    REGARDS
    RISHABH AULIYA

    Apple - Support - iPod - Repair pricing - http://www.apple.com/support/ipod/service/prices/
    ipod repair options - https://discussions.apple.com/thread/3900047 and https://discussions.apple.com/message/18867033
    Service Answer Center - iPod - http://support.apple.com/kb/index?page=servicefaq&geo=US&product=ipod  <-- enter correct country once on page.

  • AirPort Time Capsule. Read everything and tried everything. Can't get a guest network to work. Switched from bridge mode and still doesn't work. Anyone able to set up a guest network?

    AirPort Time Capsule. Read everything and tried everything. Can't get a guest network to work. Switched from bridge mode and still doesn't work. Anyone able to set up a guest network?

    I had a bright house cable modem that also had built-in wi-fi.
    Don't mean to be picky here, but if the "modem" had built in Wi-Fi, it was not a modem. It was a modem/router, also known as a gateway type of device.
    A device like this combines the functions of a separate modem and separate router in one package. Turning off the wireless on a device like this does not make a it modem.....it is still a modem/router or gateway with the WiFi turned off.
    I think that if I have them replace the current "complicated" modem with a "simple" one I should be able to get the guest network up and running.
    That would be correct. Hopefully, they offer this type of option for their customers.

  • My iPad updated and wants a security code. I tried the one from my phone and it doesn't work - I never entered a security code. How can I get in now?

    ?My iPad updated and now wants a security code for access and I never gave it one. I tried code I used for my phone and it doesn't work. How can I access now?

    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • HELP! Uploading AS3 Game to server, no sound and Spacebar doesn´t work HELP!

    Hello, relatively new to AS3 and flash, this is the first time i am publishing anything. We are trying to upload our simple flashgame to our webserver, the game works perfectly fine locally save for one thing. We get an error regarding TLF which says it wont stream or something. So when it gets online, no sounds play and spacebar doesn't work, left and right arrow does work. We have three TLF text fields that are used to update score, lives and show you final score. If i turn these into classical text they stop working.
    Things we have tried: Changing default linkage from RLS to Merged into code, changing the text boxes to classical text(they then stop working), made sure the paths are correct(all files are in the same directory including the .swz file)
    This is the code from the soundclass:
    package 
        import flash.net.URLRequest;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.events.*;
        public class MySound
            private var bgSound:Sound;
            private var fireSound:Sound;
            private var waterSound:Sound;
            private var earthSound:Sound;
            private var lightSound:Sound;
            private var soundChannel:SoundChannel;
            public function MySound()
                soundChannel = new SoundChannel();
                bgSound = new Sound();
                var req:URLRequest = new URLRequest("BackgroundSound.mp3");
                bgSound.load(req);
                //fire
                fireSound = new Sound();
                var req2:URLRequest = new URLRequest("soundFire.mp3");
                fireSound.load(req2);
                // water
                waterSound = new Sound();
                var req3:URLRequest = new URLRequest("soundWater.mp3");
                waterSound.load(req3);
                // earth
                earthSound = new Sound();
                var req4:URLRequest = new URLRequest("soundEarth.mp3");
                earthSound.load(req4);
                // light
                lightSound = new Sound();
                var req5:URLRequest = new URLRequest("soundLight.mp3");
                lightSound.load(req5);
            public function playBgSound()
                soundChannel = bgSound.play(0, 999999);
            public function stopBgSound()
                soundChannel.stop();
            public function playFireSound()
                fireSound.play();
            public function playWaterSound()
                waterSound.play();
            public function playEarthSound()
                earthSound.play();
            public function playLightSound()
                lightSound.play();
    I can somewhat get that sound can bugg out, but why does spacebar stop functioning? ANy help is greatly appreciated as this has to be delivered in twelve hours(published online) for a school assignment.

    Also might add publishing it locally in my own browser everything works, as does ofcourse playing it in flash itself. Changing from RLS to merged into code stops the error from coming, but doesn´t fix the problem on the server.
    Code from main class related to sound and spacebar:
    import flash.display.*;
        import flash.events.*;
        import flash.ui.Keyboard;
        import flash.text.TextField;
        import flash.media.Sound;
        import flash.net.URLRequest;
        import flash.events.MouseEvent;
        import flash.utils.Timer;
        import flash.events.TimerEvent;
        public class main extends MovieClip
            private var fireTimer:Timer; //delay between shots
            private var canFire:Boolean = true;
            private var mySound:MySound;
            private var bulletSpeed:Number = -450;
              public function main()
                //load sounds
                mySound = new MySound();
            private function playGame(event:MouseEvent)
                gotoAndStop(2);
                // initialize
                myLives = 5;
                myHitsNo = 0;
                weaponType = 1;
                mybullets = new Array();
                enemys = new Array();       
                myScoreTxt.text = "Score: " + myHitsNo;
                myLivesTxt.text = "Lives: " + myLives;   
                fireTimer = new Timer(400, 1);
                fireTimer.addEventListener(TimerEvent.TIMER, shootTimerHandler, false, 0, true);
                stage.addEventListener(KeyboardEvent.KEY_DOWN, listenKeyDown);
                stage.addEventListener(Event.ENTER_FRAME, addEnemy);
                stage.addEventListener(Event.ENTER_FRAME, checkCollision);   
                player = new thePlayer(stage.stageWidth-40, spawnPoint2);// stage.stageHeight/2);
                stage.focus = player;
                addChild(player);
                mySound.playBgSound();
    public function listenKeyDown(event:KeyboardEvent)  // Controls and weapontype selector
                if (event.keyCode == 37) //left
                    player.movethePlayerDown();
                if (event.keyCode == 39) //right
                    player.movethePlayerUp();
    if (event.keyCode == Keyboard.SPACE) //space
                    shootBullet();
                    //soundFX.attachSound("Pistol Fire.wav");
                    //soundFX.start();

  • Copying cells from Google Docs to Numbers doesn't work

    I've tried multiple times now to copy data from a Google Docs into a Numbers spreadsheet, to no avail. I'm trying to copy two columns of data, about 150 rows long, and instead of it pasting into two columns, it pastes into a single column in Numbers.
    Why is this? Is there a setting that affects how data is pasted into Numbers that I can change?

    BH,
    It seems that Google and Apple are still on the "outs". I found that if you Paste the Google Docs cell range to LibreOffice, and then Copy and Paste to Numbers, all is well.
    Don't try copying entire columns in Google Docs or LibreOffice, instead specify the range explicitly.
    Jerry

  • People Cannot Hear Me When I make Calls on iPhone 4, Bought a new iPhone 4, uploaded all of my own information from the backup, and it still doesnt work, help!

    I went in to apple, they couldnt figure it out, I am on AT&T so I was figuring on going into their store today and seeing if its something with the network, if not I am going back to apple, but this is literally a brand new phone i bought yesterday, not refurbished or anything, brand new, does anyone know why this isnt working? Everything else works fine, the mics both work, its just when I make calls or someone calls me the mic doesnt work.

    When you see the same issue on more than one hardware device, it means that the problem is likely to exist outside of the hardware.  Two things to investigate would be the software/firmware on the backup and issues with the cellular network.  It's probably safe to rule out the cellular network as well.
    First, make sure that you have imported copies of all the information (pictures, videos, documents) on the device.  Do this thorough itunes, and the applications (photographic and document processing) on your computer.  Perform a firmware update then restore the device as new.  If the problem persists, then you may actually have the worst luck and discovered two devices with an identical issue.
    Read each of the steps before initiating the DFU.
    !.  Connect the iPhone to any computer running a fully updated version of iTunes.
    2. Press and hold both "home" and "sleep/wake" buttons
    3. After eight seconds let go of only the sleep/wake button.
    4. Keep holding the home button until you see a popup mesage in iTunes.
    5. Read all all the popups, then use iTunes to update the iPhone's software.
    If the popup fails to show, repeat steps 2 through 4

  • Hi! I want to transfer my old mails from mac book pro to iPad 2, Please help me on this.

    Hi! I want to transfer my old mails from mac book pro to iPad 2, Please help me on this.

    Did you select the Pages app to sync to the iPad? Do you know how to do that or do you auto sync and rely on that only?

  • Can I copy pages from a book I am reading on the iPad to the ipad

    I am reading a library book in overdrive is it possible to copy pages from the book to be read on the iPad after the book is returned?
    Thanks for your response
    Cin 

    I don't have a library book checked out at the moment, so I can't play, but have you tried to select a section of text, and then copy it?  If that works you can then go to Notes or Pages, create a new document and paste it in.
    If not, you can try screen shots:  press and release both the Home button and the Power button together, you should hear a camera shutter sound.  You can take as many screen shots as you want.  You will find the screen shots on your camera roll in Photos.

  • I am trying to install SC6 Photoshop and Bridge on a new Mac laptop.  Though I have the software the laptop doesnot have a disk drive so I copied it from my desktop and transferred it via a portable hard drive.  I get a message:  Configuration error. Peas

    I am trying to install SC6 Photoshop and Bridge on a new Mac laptop.  Though I have the software the laptop doesnot have a disk drive so I copied it from my desktop and transferred it via a portable hard drive.  I get a message:  Configuration error. Please uninstall and reintall...   Error 16

    Hi midtone,
    Is it possible to download the product? It seems that copying didn't work.
    If you can download then please use this link: Download CS6 products
    -Ankit

  • Dail from Address Book and Use Mac as a speakerphone??

    I really, really, really want to be able to dail a phone number from Address Book and then talk to the person on the phone line using my G5... I tried a couple of softwares but was.....OH SO DISAPPIONTED.......Does anyone know what I can do to remedy this.
    It would also be okay if I could have a little app that does that an be able to redail the number until I get an answer... .......Please Help... I spend a lot of time on my phone and also need to multitask....

    If you can't get the exported .csv file to work you might consider using Migration Assistant: http://support.apple.com/kb/HT2518, particular if you need to move more than just your contacts.  There is some granularity in the options on what to transfer but I'm not sure if you can choose to just your migrate contacts.

  • How to merge faces from address book and Facebook?

    I like faces, however, when I start to type the name of somebody on the picture (me), I can choose 2 different "me" - one is from address book and on from facebook. Is there any possibility that Facebook would recognize people from facebook and connect them to my address book (or the other way)?

    I found this:
    In Address Book (or "Contacts") select both cards that correspond to the same person (probably one card you created and the other generated from facebook), you can do this by Command+clicking.
    Then, under 'Card' menu select 'Link Selected Cards'. Voila, they are now one card. Address Book still remebers these are two seperate cards, and you can always edit this back later.
    If you prefer, you can then select the "leading" card that will be represented in the name, through the 'cards' field at the bottom of that person's card.
    Since iPhoto uses Address Book's database, this should solve the duplicate person problem, though I haven't tested this thouroughly.
    Hope this helps.

  • Opening files with Illustrator and photoshop doesn't work, i have to drag the files from finder in to the program. This problem appears after opening 4 a 5 files.

    Opening files with Illustrator and photoshop doesn't work, i have to drag the files from finder in to the program.
    This problem appears after opening 4 a 5 files, rebooting helps another 4 a 5 times and appears again.

    I'd recommend reposting in the Boot Camp forum, that is where the Boot Camp and Windows gurus hang out.
    Good luck.

  • I'm having problem  with my icloud account,I don't have access to the email i once used to set up my icloud account,this is really affecting me,I can't backup and restore anything from my phone and device..anybody can help?

    I'm having problem  with my icloud account,I don't have access to the email i once used to set up my icloud account,this is really affecting me,I can't backup and restore anything from my phone and device..Can somebody help?

    Hi Maastricht2014,
    Until and unless you remember the password to your old email address, you will not be able to access the eBooks as those eBooks are only authorized with your old email address only.
    The only workaround or alternative to access your eBooks will be to contact the eBook vendor and ask them to migrate the eBook from your old email to the new one.
    Hope that Helps!
    ~ Arpit

  • When I rest my mobile I try to restore from iCloud backup but I got a message saying the service unavailable .I am doing this from 2 days and the Broblem still what should I do ?

    When I rest my mobile I try to restore from iCloud backup but I got a message saying the service unavailable .I am doing this from 2 days and the Broblem still what should I do ?
    <Email Edited by Host>

    Go to System Preferences/Accounts
    Click on your name
    Select 'Allow user to administer this computer'

Maybe you are looking for