identifier expected � why show up when I was trying to compile !

When i was trying to add another botton as a " buttonAdd " I will get the error message so I would be glad to help me , please !
import java.awt.*;
import java.applet.*;
import java.applet.Applet;
import java.awt.event.*;
import java.awt.image.*;
public class PhotoAlbum extends Applet implements ActionListener{
// declare all the components
     Button
               previous = new Button("Previous"),
               first = new Button("First"),
               last = new Button("Last"),
               next = new Button("Next");
               buttonAdd = new Button("Display");
     Canvas
               imageCanvas = new Canvas();
     final int total = 10;               // total # of images
     int i = 0;                    // this is value of currently displayed image
     Image Pictures[] = new Image[total];
public void init() {
     makeGui();
          // get all the images
          for (int p=0; p < total; p++) {
               Pictures[p] = getImage(getCodeBase(), "Photos/image"+p+".JPG");
               prepareImage(Pictures[p], this);
     } // init
     private void displayImage(int n) {
          // Display the nth image on the canvas
          Graphics g = imageCanvas.getGraphics();
          g.clearRect(10, 10, 400, 400);
          g.drawImage(Pictures[n], 30, 10, this);
          g.drawString("Image: "+(n+1)+" � "+total, 30, 380);
     } // displayImage
     public void drawFirst(){
          displayImage(0);
     } // drawFirst
     public void drawLast(){
          displayImage(total-1);
     } // drawLast
     public void drawPrevious(){
          i = i - 1;
          if (i <= -1){
               i = total-1;
          displayImage(i);
     } // drawPrevious
     public void drawNext(){
          i = i + 1;
          if (i == total){
               i = 0;
          displayImage(i);
     } // drawNext
     public void actionPerformed(ActionEvent e){
          if (e.getSource() == previous)
               drawPrevious();
          else if (e.getSource() == first)
               drawFirst();
          else if (e.getSource() == last)
               drawLast();
          else if (e.getSource() == next)
               drawNext();
else if (e.getSource() == buttonAdd)
               drawLast() ;
     } // actionPerformed
     public void paint(Graphics g) {
          drawFirst();
          i = 0;
     private void makeGui() {
          setBackground(Color.black);
          setForeground(Color.white);
          setLayout(new BorderLayout());
          Panel p1 = new Panel();
          p1.add(previous);
          p1.add(first);
          p1.add(next);
          p1.add(last);
          p1.add(buttonAdd);
          add(BorderLayout.NORTH, p1);
          add(BorderLayout.CENTER, imageCanvas);
          previous.addActionListener(this);
          first.addActionListener(this);
          last.addActionListener(this);
          next.addActionListener(this);
          buttonAdd.addActionListener(this);
     } // makeGui
} // PhotoAlbum

Because you left the semicolon at the end of the line before it, instead of changing it to a comma.

Similar Messages

  • Safari Browser in my iPhone 5S Hangs/Crashes when I was trying to open an Youtube video.Why is this happening?

    My iPhone 5S(Boasted as Worlds smartest smartphone) Hangs/Crashes when I was trying to open any Youtube video....
    Is there any fix for this apple.......???
    I love my iPhone 5s.But I'm pretty dissapointed.
    Coz...........
    Feeling ashamed of buying a smartphone worth Rs.51,000 which can't play a youtube video in its stock browser.
    Its a zippy task that can be done by a mobile worth Rs.5,100........
    Its shame on your part Apple..........
    Please fix this as soon as possible.
    Consider this bug & fix this in iOS 8......

    Google's Chrome browser is very well capable of doing what I want with ease....(on my iPhone)
    But Apple's Safari browser(much praised) cant move a speck on it...
    Why???........Whats wrong with the stock Safari Browser???

  • When I was trying to get icloud downloaded to my ipad I got an 1603 error. Then my ipad got the beginning hook up to itunes as you get when you first try your new ipad.

    When I was trying to get icloud downloaded to my ipad 2 I got an 1603 error.   Now my ipad 2 is showing the icon tha says to hook up to itunes.

    http://support.apple.com/kb/TS3694#error1603
    There have been some problems accessing pages on the Apple web site.  If the hyperlink gives you a "We're sorry" message, try again.

  • I recently set up multiple accounts and when I was trying to figure out how to share files I messed up something in my documents. Everytime I open a doc from the ADMIN account, a box pops up that says "The file is not in the correct format" how to fix?

    I recently set up multiple accounts on my imac, When I was trying to figure out how to share the documents I must have done something wrong. When logged into the Admin account, I open up any document and I get a message box that says, "The Document could not be opened. The file isn't in the correct format. The file might be corrupted, truncated, or in an unexpected format." What did I do and how do I fix it?

    Without knowing what you did it is impossible to give advice on how to correct it.
    If these were files you copied over from some other system then just Re-Copy them replacing the ones that are corrupted.
    Other then that I suggest you Wipe the drive and start over with a clean reinstall of the OS and programs. Then if you want to share files to All Accounts place those files in a folder in the ROOT of the drive.

  • I bought my iphone 5 in the USA but am living in the UK. When I was trying to download apps, it said i need to connect to the uk apple store, how do i do that?

    I bought my iphone 5 in the USA but am living in the UK. When I was trying to download apps, it said i need to connect to the uk apple store, how do i do that?

    Settings > iTunes & App Stores
    Tap on your Apple ID at the top
    Tap "View Apple ID"
    Enter password if needed
    Tap "Country/Region"
    Tap "Change Country or Region"
    You may need to change to a UK credit card.

  • I accidentally deleted my media files from iTunes and Trash when I was trying to move the files to an external hard drive. Is there a way to restore the media files from a Time Machine backup or from iTunes Match? What are the steps to do this?

    I accidentally deleted my media files from iTunes and Trash when I was trying to move the files to an external hard drive. Is there a way to restore the media files from a Time Machine backup or from iTunes Match? What are the steps to do this?

    If you have been backing up on Timemachine.
    All you need to do is enter time machine... Then the rest is obvious.
    Find the iTunes folder and hit 'Restor'.
    If not the only way to get all your iTunes music back is to enter iTunes Store.
    On the right hand side you should see 'Purchased'.
    Click 'purchased' and there you have it.

  • TS1591 My iphone 4 randmonly started going into recoveery mode when i was trying to download ios 7.1, and now the apple logo will come one and then fade to black and continue this process. My iphone wont restore either and will get the 3194 error message.

    My iphone 4 randmonly started going into recoveery mode when i was trying to download ios 7.1, and now the apple logo will come one and then fade to black and continue this process. My iphone wont restore either and will get the 3194 error message.Help please!

    Hello chindeepchow,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    Resolve specific iTunes update and restore errors
    http://support.apple.com/kb/ts3694#3000
    Resolve communication issues
    Related errors: 17, 1004, 1013, 1638, 3014, 3194, 3000, 3002, 3004, 3013, 3014, 3015, 3194, or 3200. These alerts refer to gs.apple.com, say "There was a problem downloading the software," or say the "device isn't eligible for the requested build."
    Check the hosts file or TCP/IP filtering, which might cause communication issues between iTunes, ports, and servers.
    Have a nice day,
    Mario

  • When i was trying to update my iphone 4s from 6.1.4 to ios 7,its asking to change the media sync  options,how can i change that option,can any one help me.........?

    when i was trying to update my iphone 4s from 6.1.4 to ios 7,its asking to change the media sync  options,how can i change that option,can any one help me.........?

    I tried powering down and re-starting the iPhone (as suggested at http://support.apple.com/kb/TS1275). This seems to have cleared the "...not connected to the Internet" problem, and iOS 6.1 is now in the process of downloading.
    Thanks very much for your feedback.

  • I accidentally clicked add to dictionary on a misspelled word when I was trying to click the right spelling for it. How can I undo that so it will catch the misspelled word?

    I accidentally clicked add to dictionary on a misspelled word when I was trying to click the right spelling for it. How can I undo that so it will catch the misspelled word?

    You need to edit a file in your profile folder, for details see [[using the spell checker]].

  • Get an error when I was trying to new a Enviroment object

    As you see, the code is very simple, and i got an exception when I was trying to execute the following code env = Environment::createEnvironment (Environment::OBJECT); I have also tried env = Environment::createEnvironment ();
    The result is exactly the same, I looked up the errorcode table on the oracle website, the explanation is ORA-32104: cannot retrieve OCI error message
    Cause: Error message after an OCI call could not be retrieved.
    Action: This is an internal OCCI Error. Please contact customer support.
    So I am confused with the error, any help would be greatly appreciated.
    I use the VS 2005 with the dll and lib released by oracle for oracle 10G
    #include <iostream>
    #include <algorithm>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    int main (int argc, _TCHAR* argv[])
    Environment *env;
    try
         env = Environment::createEnvironment (Environment::OBJECT);
    catch(SQLException e)
         cout << e.getErrorCode();
    }

    This could be a problem with Ur client installations. ENVs are not set properly. Reinstall the client and try.
    Is your SQLPLUS is working fine.....???
    Then it could be a lib mismtach.

  • What would cause imovie to keep quitting.  Lately it kept doing it when i was trying to change the text theme on a clip.  I just updated to imovie 11.  I have a macbook pro with OSX 10.6.8

    imovie has been quitting unexpectedly lately.....the latest was when I was trying to change the text theme on a clip. I have two external drives for my events and projects. 
    Also does imovie 11 only let you use the comic book transitions when you set that as your project theme?

    imovie has been quitting unexpectedly lately.....the latest was when I was trying to change the text theme on a clip. I have two external drives for my events and projects. 
    Also does imovie 11 only let you use the comic book transitions when you set that as your project theme?

  • Error message "Please contact iTune support to complete this transaction" when I was trying to purchase an app

    Error message "Please contact iTune support to complete this transaction" when I was trying to purchase an app????
    Help!! Any one experience this issue???
    iTune support, "You are violating the iTunes Store Terms and Conditions specifically, however we're unable to speculate. You are not authorized to purchase from the US iTunes Store. From here please continue to review the terms and conditions in detail for further information."
    Do you guys even read the "Terms and Conditions" ? There are thousands of words. who know what term I am violating. It works fine before 12/01/2012...I bet they don't even know what caused this problem...They keep asking me to read it without solving the problem...

    "Dose that just happen after December 2012??"
    No.  It has always been that way.
    "So people who live in USA and while travel to other country are not allowed to buy anything? "
    Correct.
    "how about people who work oversea for long term?" 
    They would need an itunes account based in the country in which they live.
    "The iTunes Service is available to you only in the United States, its territories, and possessions. You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance."
    http://www.apple.com/legal/itunes/us/terms.html#SERVICE
    It is the same for all countries itunes stores.

  • My itunes doesn't open from the dock... when I get it open by spotlight it froze when I was trying to burn a CD.

    My itunes doesn't open from the dock... when I get it open by spotlight it froze when I was trying to burn a CD.

    Hi stork38,
    Welcome to the Support Communities!
    It sounds like the application is having an issue burning the CD.
    I would suggest you Force Quit iTunes, eject the disc and then open iTunes again.
    Then try burning again with a different CD.
    Mac OS X: How to quit an unresponsive application using Force Quit
    I hope this information helps ....
    Have a great day!
    - Judy

  • I just updated my iPad2 to ios7 and everything returned except my movies. Why??? I was trying to ADD a movie for my 5 year old and it said I needed a later iOS. Now he has ZERO movies!!!! Just great!!

    I just updated my iPad2 to ios7 and everything returned except my movies. Why??? I was trying to ADD a movie for my 5 year old and it said I needed a later iOS. Now he has ZERO movies!!!! Just great!! Can anyone help??

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • HT4759 I have never used  "iwork for cloud beta" or "google chrome" to my knowledge to print. I wish icloud to please and thank you for you to delete this information! as it shows in the advanced settings for icloud when I was trying to print an index of

    My note on my ipad and Iphone have an index of the notes to the left on my copnuter!  I wanted to only print the index and the date after the index.  The computer would allow me to print the note but not the date it was indexed or the title to the left! of the index date!  Has anyone ever had this problem!  I am changing laptops and wanted to keep an index printed out for references but delete all the notes from this old notebook! 
    Please note my Ipad automatically changed to the ios7 update even when the Iphone 5 was with my spouse in Norfolk Va.  I had purchased an iphone 5 in feb with 32 gb verses 16 I was happy with it until I thought I was updating itunes to fix bugs and fixes.  It updated the ios7 program and the whole look of the iphone five changed and I am over 58 and have trouble keeping up and did not want to update!  I callled and had 436 days of insurance left on my phone and I asked them to keep te money for the upgrade and just give me back the 6ios. of course it is know.  Apple was trying to helpe get up to speed but the calendar was given me the most difficulty not being able to see appts forward enough to plan very well!  My spouse is retiring from the DOD  and for the first time in his life can have his on cell so I gave him my 5 and still had my old 4 got my ios6 back and  just now the phone is feeling pretty comfortable again for me. The only thing missing is siri i do miss her!  I never anticipated that my ipad would change to the ios7 on its on but the applestore in Tampa said that yes that happens oops! I now will try to self educate myself on the ios7.  I love my ipad but wish it had not jumped to the 7ios.  big problem again is I have is on my 5 it wasa a 32 and I have double or the max of icloud storage but just learned at the apple store that icloud does not store your photos on the cloud.  I am a grandmother and the soul pupose of me purchasing so much icloud storage was for my grandkids pics and now I found out you guys don't do this.  Where do you store the photos for people?   Help!  have mercy on me because even though the 436 days of service from Icloud left on my iphone 5 my spouse is the only one that can use it even tho my ipad automatically switched to the ios 7.  Really am trying to work with you apple because I think you have a better product but as far as customer service you can make an appt at the service center an hour away and then wait inline for 40 minutes for the genuis bar guys to make you feel like an idiot for not figuring this out on your own or I have to pay just to talk to your service department after I already have in my name 436 days left on my service contract!  The contract only goes with the phone even though your update changed my ipad also!  A little customer service that is given free of charge when you have some one really trying to educate themselves on and ios7 that they didn't even want would go a very long way toward keeping your customers happy otherwise once a more friendly tech company that offers the better product tops you. Its over!  You have a great product and people are paying you to help them lean how to navigate it!  The problem is once you have mastered one system that system is updated and you start over!  Maybe you could offe something for everyone!  You see my husband doesn't have to ever call apple because he has and IQ to high to measure!   Unfortunately the service I payed for is with his phone and I now have and I pad with the ios7 that converted automatically and when I call they tell me I must be told there will be a fee charged for this service!   One question I asked the support center apple store is how can the ipad convert when the iphone 5 is at the Norfolk Navy Base with my spouse and the ipad is here in Spring Hill Florida with me.  She said it just happens!  The service center nearest available to me is 1 hour away and I need an appt. With them to ask a simple question!.  Time is a commodity that is becoming more dear to me every day and it seems I am spending a great deal of it trying to solve a somewhat simple question to the experts no more than a 3 minute conversation could set me on the right track but I can't even buy insurance service for my ipad that just converted to ios 7 on its's own!  Sincerely I could use some help
    <E-mail Edited by Host>

    My note on my ipad and Iphone have an index of the notes to the left on my copnuter!  I wanted to only print the index and the date after the index.  The computer would allow me to print the note but not the date it was indexed or the title to the left! of the index date!  Has anyone ever had this problem!  I am changing laptops and wanted to keep an index printed out for references but delete all the notes from this old notebook! 
    Please note my Ipad automatically changed to the ios7 update even when the Iphone 5 was with my spouse in Norfolk Va.  I had purchased an iphone 5 in feb with 32 gb verses 16 I was happy with it until I thought I was updating itunes to fix bugs and fixes.  It updated the ios7 program and the whole look of the iphone five changed and I am over 58 and have trouble keeping up and did not want to update!  I callled and had 436 days of insurance left on my phone and I asked them to keep te money for the upgrade and just give me back the 6ios. of course it is know.  Apple was trying to helpe get up to speed but the calendar was given me the most difficulty not being able to see appts forward enough to plan very well!  My spouse is retiring from the DOD  and for the first time in his life can have his on cell so I gave him my 5 and still had my old 4 got my ios6 back and  just now the phone is feeling pretty comfortable again for me. The only thing missing is siri i do miss her!  I never anticipated that my ipad would change to the ios7 on its on but the applestore in Tampa said that yes that happens oops! I now will try to self educate myself on the ios7.  I love my ipad but wish it had not jumped to the 7ios.  big problem again is I have is on my 5 it wasa a 32 and I have double or the max of icloud storage but just learned at the apple store that icloud does not store your photos on the cloud.  I am a grandmother and the soul pupose of me purchasing so much icloud storage was for my grandkids pics and now I found out you guys don't do this.  Where do you store the photos for people?   Help!  have mercy on me because even though the 436 days of service from Icloud left on my iphone 5 my spouse is the only one that can use it even tho my ipad automatically switched to the ios 7.  Really am trying to work with you apple because I think you have a better product but as far as customer service you can make an appt at the service center an hour away and then wait inline for 40 minutes for the genuis bar guys to make you feel like an idiot for not figuring this out on your own or I have to pay just to talk to your service department after I already have in my name 436 days left on my service contract!  The contract only goes with the phone even though your update changed my ipad also!  A little customer service that is given free of charge when you have some one really trying to educate themselves on and ios7 that they didn't even want would go a very long way toward keeping your customers happy otherwise once a more friendly tech company that offers the better product tops you. Its over!  You have a great product and people are paying you to help them lean how to navigate it!  The problem is once you have mastered one system that system is updated and you start over!  Maybe you could offe something for everyone!  You see my husband doesn't have to ever call apple because he has and IQ to high to measure!   Unfortunately the service I payed for is with his phone and I now have and I pad with the ios7 that converted automatically and when I call they tell me I must be told there will be a fee charged for this service!   One question I asked the support center apple store is how can the ipad convert when the iphone 5 is at the Norfolk Navy Base with my spouse and the ipad is here in Spring Hill Florida with me.  She said it just happens!  The service center nearest available to me is 1 hour away and I need an appt. With them to ask a simple question!.  Time is a commodity that is becoming more dear to me every day and it seems I am spending a great deal of it trying to solve a somewhat simple question to the experts no more than a 3 minute conversation could set me on the right track but I can't even buy insurance service for my ipad that just converted to ios 7 on its's own!  Sincerely I could use some help
    <E-mail Edited by Host>

Maybe you are looking for

  • Trigger Outbound Idoc on Customer Master change/ Create

    Hi everyone, can anyone provide me some information on how to trigger outbound IDOCs when a customer master is changed/created and which IDOC should be used. Kind Regards, Julian

  • JSON with ABAP webservices and BSP

    Hi All, I am new to JSON, Could you please provide information related JSON with web services and BSP services. Thanks in advance, Rajesh. Moderator message: please search for available information/documentation. Edited by: Thomas Zloch on Jan 9, 201

  • I can't log in using password. Each time I enter the log in box comes back unpopulated with my password.

    I can't log in to the Imac. Each time I enter my password it is initially accepted then the screen reverts to the log in dialogue box again withhout being populated by the password entered.

  • WiSM - Managing AP's at remote sites

    A quick wireless newbie question - I'm trying to sort out the design details using a WiSM. I have a new site and have budgeted a pair of 6513's with WiSM's. There are 9 branch offices that are going to be connected via 2821 routers over CSME and they

  • Odd symbol for "Hide and show Front Row"   ⌘⎋

    Was just browsing my keyboard shortcuts in System Prefs and came saw the shortcut for "Hide and show Front Row." it was the command symbol and then something that I at first through was the power symbol. When i looked closer, I realized it was a 3/4