CAN SOMEONE FIX THIS????

Hello, I can't get my program to work at all, I keep getting errors. Can someone please see if they can fix these Exception errors. I've posted tons of topics but I still can't get this program to run.
I use these text files in the program.
EVENT.txt
1 C++ Programmer
2 Business Management
STCLASS.txt
1 Tech Apps
2 Computer Programming
3 AP Computer Science
4 AB Computer Science
5 AP Biology
6 AP US History
STINFO.txt
34865-Joe Peace-2003-01-02-1-2-3-4-5-6
89398-John Carr-2003-04-05-1-2-3-4-5-6
Here is The Actual Program, Can anyone get rid of the Exception Errors:
//Program Starts Here
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class TrivialApplet extends Applet implements ItemListener, ActionListener
     TextField text1;
     CheckboxGroup checkboxgroup1;
     Checkbox checkbox1, checkbox2, checkbox3;
     Button adder;               //Button in addperson()
     Button cpsubmit;          //Button in clienpart()
     Button quit;               //Button in addperson() and search() - Returns to clientpart() when pressed
     Button ssubmit;               //Button in search()
     int where;                    //'Where' is the current position the user is in the program
     int what;                    //'What' is current checkbox that the user has selected
     int searcher;               //What User Is Searching for (ID, Event, Or Class)
     String line;               //'line' is used when a line is taken from a text file
     PrintWriter fileOut;     //Output to textfile Variables
     BufferedReader fileIn1,fileIn2,fileIn3;     //Inputting from textfile variables
     ******************************************** init() *******************************************************************
     public void init()
          what = 0;
          where = 0;
          searcher = 0;
          quit = new Button("Return To Menu");
          clientpart();
     ******************************************** clientpart() *************************************************************
     public void clientpart()
     removeAll();                                             
     setSize(300,200);
     where = 1;
     setLayout(new GridLayout(4,1));                                        //Sets Layout of Screen
     checkboxgroup1 = new CheckboxGroup();                         
     checkbox1 = new Checkbox("Search For A Person",false,checkboxgroup1);                    //Check Box
     checkbox2 = new Checkbox("Enter New Person Into Database",false,checkboxgroup1);
     cpsubmit = new Button("Submit");
     Label info;
     info = new Label("Select An Option And Press Submit", Label.CENTER);
     add(info);
     add(checkbox1);
     add(checkbox2);
     add(cpsubmit);
     checkbox1.addItemListener(this);
     checkbox2.addItemListener(this);
     cpsubmit.addActionListener(this);
     ******************************************** addperson() **************************************************************
     public void addperson() throws IOException
     setSize(400,300);
     PrintWriter fileOut = new PrintWriter(new FileOutputStream("C:/Documents and Settings/Joe/AP Programs/BPA Database/STINFO.TXT", true));
     where = 2;
     removeAll();                                                            //Remove everything from applet
     Label stat;
     stat = new Label("Select A Field, Enter Info, And Click Submit", Label.CENTER);
     setLayout(new GridLayout(5,1));
     add(stat);
     text1 = new TextField("ID-Name-Graduating Year-Event 1-Event 2-Class 1-Class 2-Class 3-Class 4-Class 5-Class 6");//New TextField
     checkboxgroup1 = new CheckboxGroup();                              //A group of checkboxes, allows only ONE click
     adder = new Button("Submit");                                        //Submit button
     add(text1);                                        
     add(adder);
     add(quit);
     adder.addActionListener(this);                                        //Checks for button actions
     quit.addActionListener(this);
     ************************************************** search() ***********************************************************
     public void search() throws IOException
     setSize(400,300);
     /********************************************** Variables to get info from text files *******************************/
     fileIn1 = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Joe/AP Programs/BPA Database/STINFO.TXT")));
     fileIn2 = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Joe/AP Programs/BPA Database/EVENTS.TXT")));
     fileIn3 = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Joe/AP Programs/BPA Database/STCLASS.TXT")));
     where = 3;                                                                 //User Is At Position '3'.....or search()
     searcher = 0;
     removeAll();                                                            //Remove everything from applet
     /************************************* Creates a label that cannot be edited ***************************************/
     Label stats;
     stats = new Label("Click Field You Wish To Search By, And Click Submit", Label.CENTER);
     setLayout(new GridLayout(6,1));                                        //Makes applet a 6x1 Array for objects
     add(stats);
     checkboxgroup1 = new CheckboxGroup();                              //A group of checkboxes, allows only ONE click
     ssubmit = new Button("Submit");                                        //Submit button
     checkbox1 = new Checkbox("ID",false,checkboxgroup1);          //Sets The First Checkbox into checkboxgroup1
     add(checkbox1);                                                            //Add this to window
     checkbox2 = new Checkbox("Event",false,checkboxgroup1);               
     add(checkbox2);
     checkbox3 = new Checkbox("Class",false,checkboxgroup1);
     add(checkbox3);
     add(ssubmit);
     add(quit);
     /*********************************************** Calls itemStateChanged() when clicked ***************************/
     checkbox1.addItemListener(this);                                   
     checkbox2.addItemListener(this);
     checkbox3.addItemListener(this);
     ************************************************ Cals actionPerformed() when clicked *****************************/
     ssubmit.addActionListener(this);
     quit.addActionListener(this);
     ******************************************** actionPerformed() ********************************************************
     public void actionPerformed(ActionEvent e)
          /************************ clientpart() buttons **********************************************************/
          if (e.getSource() == cpsubmit && what == 1)               //If User wants to search for a person then search()
               search();
          if (e.getSource() == cpsubmit && what == 2)               //If User wants to Add A New Person then addperson()
               addperson();               
          /************************ quit button returns to clientpart() *******************************************/
          if (e.getSource() == quit)                                   //If User wants to return to main menu then clientpart()
               clientpart();
          /************************ addperson() buttons ***********************************************************/
          if (e.getSource() == adder)                                   //Prints New Person To STINFO.txt
               fileOut.println(text1.getText());
          /************************* search() buttons *************************************************************/
          if (e.getSource() == ssubmit && searcher == 1)          //Shows Everyone In School     
               while((line=fileIn1.readLine()) != null)
                    System.out.println(line);
          if (e.getSource() == ssubmit && searcher == 2)          //Shows Events With Numbers
               while((line=fileIn1.readLine()) != null)
                    System.out.println(line);
          if (e.getSource() == ssubmit && searcher == 3)          //Shows Classes With Numbers
               while((line=fileIn3.readLine()) != null)
                    System.out.println(line);
     ******************************************** itemStateChanged() *******************************************************
     public void itemStateChanged(ItemEvent e)
          /*************************************** Checkboxes in clientpart() *****************************************/
          if (e.getItemSelectable() == checkbox1 && where == 1)               
               what = 1;
          if (e.getItemSelectable() == checkbox2 && where == 1)
               what = 2;
          /*************************************** Checkboxes in search() *********************************************/
          if (e.getItemSelectable() == checkbox1 && where == 3)
               searcher = 1;
          if (e.getItemSelectable() == checkbox2 && where == 3)
               searcher = 2;
          if (e.getItemSelectable() == checkbox3 && where == 3)
               searcher = 3;

An error
1> exception not caught
public void actionPerformed(ActionEvent e)
try{
<your code>
catch(Exception ex)
ex.printStackTrace();
Explaination: your methods like search() and etc are throwing excpetion but it is not caught so you will have to catch it. The example up here is catching for all but you should tune it a bit to specific exceptions
A suggestion
1> your removeall() method is not very nice. Why don't u use card layout and hide the panel instead of removing and adding all again

Similar Messages

  • I am not able to download any  app on my ipad mini , it shows its loading, but never getting downloaded , can someone fix this for me ???

    i have a ipad mini , ios version 8.3 .... i am not able to download any app currently on my ipad.... i am not able to figure out the problem , it shows the app is loading in app store , but its never getting downloaded....how do i fix this problem ??? can someone please figure it out ???

    Welcome to the Apple Community.
    When your account becomes disabled, Apple provides the following recommendation:
    "This message means that someone tried and failed to sign in to your account multiple times. The Apple ID system disables the account to prevent unauthorized people from gaining access to your information. You need to reset your password, following the instructions at the Apple ID website".
    Visit iForgot.com and follow the instructions there.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    Providing you are simply updating your existing details and not changing to another account, when you delete your account, all the data that is synced with iCloud will also be deleted from the device (but not from iCloud), but will be synced back to your device when you login again.
    In order to change your Apple ID or password for your iCloud account on your computer, you need to sign out of the account from your computer first, then sign back in using your updated details. (System Preferences > iCloud, click the sign out button)
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > store, scroll down and tap your ID)
    If that doesn't help you might try contacting Apple through iTunes Store Support

  • Even on Firefox 28.0 i can't load my new pages to a tab but rather it opens a new window and i see ths has been around for quite a while, can someone fix this u

    I can't load pages into a new tab anymore even when i right click a link and say open in a new tab it doesn't yet i use Firefox 28.0. even when i tried 29 alpha it still had the same problem.
    What is the solution?

    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings and disables most add-ons (extensions and themes).
    ''(If you're using an added theme, switch to the Default theme.)''
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu by clicking on the '''Restart with Add-ons Disabled...''' menu item:<br>
    [[Image:FirefoxSafeMode|width=520]]<br><br>
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Can someone fix the error?

    can someone fix this?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.event.MouseEvent;
    public class MouseTest extends Applet
            implements MouseListener {
        //declare some mouse event variables
        int pressx, pressy;
        int mousebutton;
        //initialize the applet
        public void init() {
            addMouseListener(this);
            addMouseMotionListener(this);
        //redraw the applet window
        public void paint(Graphics g) {
            g.drawString("Mouse pressed " + mousebutton + " at " + pressx + "," + pressy, 10, 55);
        //custom method called by mouse events to report button status
        private void checkButton(MouseEvent e) {
                //check the mouse buttons
                switch(e.getButton()) {
                case MouseEvent.BUTTON1:
                    mousebutton = 1;
                    break;
        public void mousePressed(MouseEvent e) {
            pressx = e.getX();
            pressy = e.getY();
            checkButton(e);
            repaint();
        public void mouseMoved(MouseEvent e) {
            movex = e.getX();
            movey = e.getY();
            repaint();
    }

    movex = e.getX();
    movey = e.getY();Where the hell did you declare movex and movey variables?
    g.drawString("Mouse pressed " + mousebutton + "
    at " + pressx + "," + pressy, 10, 55);What do you even plan on doing with them? Do you plan on printing their values here?
    The error message you get when you compile this program wuld explain EXACTLY what is wrong with it.
    God you are stupid.

  • Someone hacked my computer and set up a new administrative account by re-registering my computer. I can not access this account nor delete it. How can I fix this and get my computer back to the way it was?

    Someone hacked my computer and set up a new administrative account by re-registering my computer. I can not access this account nor delete it. How can I fix this and get my computer back to the way it was? And also prevent this from being able to happen again. I have the link the kid used (http://www.ihackintosh.com/2009/05/how-to-hack-the-user-password-in-mac-os-x-wit hout-an-os-x-cd/) Apparently he used hack 2. HELP PLEASE!

    Not sure why you can't delete that account. If you have admin privileges, you should be able to. Sounds like you only removed the Home Folder for that account.
    You should highlight/select the account you want to remove and then click the minus button. Might need to unlock the padlock with your admin password.
    Have a look at these articles from Apple, if necessary.
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8235.html
    http://docs.info.apple.com/article.html?path=Mac/10.5/en/8162.html
    http://support.apple.com/kb/DL1399

  • My email does not have the correct email when i send to someone. It has my mothers. How can i fix this?

    When I send an email to someone or reply to them it sends it under my mother's name. How can i fix this?

    It may be that you have more than one outgoing mail account, and you're sending from the wrong one. From the Mail menu bar, select
              Mail ▹ Preferences...
    The Mail preference dialog opens. Select the Composing tab from the row of icons at the top. From the menu labeled
              Send new messages from:
    choose
              Account of selected mailbox
    Note that this setting may have no effect if you start a new message while a VIP or smart mailbox is selected in the mailbox list. Those are saved searches, not actual mailboxes.
    If the problem remains, select the Accounts tab in the preference dialog, then select the affected account in the list on the left.
    In the Account Information pane, select the correct server in the menu labeled
              Outgoing Mail Server (SMTP)
    If there's only one server in the menu, select
              Edit SMTP Server List...
    and add a new server with the correct settings. If you're not sure how to do that, try the Mail Settings Lookup.
    Another possibility is that the wrong card in your address book is selected as yours. Select your card in the Contacts application. Then select
              Card ▹ Make This My Card
    from the menu bar.

  • My email address is being used to send emails everyday by someone else? Can I fix this?

    I'm getting about 30 messages a day with this subject "Mail delivery failed: returning message to sender" and no recognizable email addresses in the list included.
    Can I fix this without changing my email account?
    If not, are there steps outlined for transferring from this account to a new one?
    Thanks.

    Create a new profile as a test to check if your current profile is causing the problems.
    *https://support.mozilla.org/en-US/kb/profiles-tb
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Thunderbird
    *http://kb.mozillazine.org/Profile_Manager

  • Someone else is using my email id for facetime and imessage, how can i fix this??

    How can i fix this??

    To elaborte on Davids response aortiz5 you can got to appleid.apple.com and click the option to manage your apple id.  Here you will be able to change your primary apple id and email address if you want. Or if this is your apple id and you think some one else has access to it you can click on passwords and security on the left and change your password for your apple id which will cause the other devices to prompt for the new password.

  • I own a 13-inch MacBook Pro and for the past day, my wifi on my laptop says I only have two bars of connection and is running very slow,but all of my other devices such as my iPhone and iPad are connecting perfectly to the wifi. How can I fix this? Thanks

    I own a 13-inch MacBook Pro and for the past day, my wifi on my laptop says I only have two bars of connection and is running very slow,but all of my other devices such as my iPhone and iPad are connecting perfectly to the wifi. How can I fix this? I have tried to shut my laptop off and let it rest and I have also re-started my wifi router three different times. Someone please help me with this problem so I can begin to use my laptop again as I take it to school and use it for class.
    Thanks so much!

    FCP, and all software on OSX, has a few different "preference" files (the extension is .plist), which store all your user settings. Each time you resize a window, change a setting, anything, this file is re-written. Kinda easy to see how they would become corrupt every now and then.
    -Close FCP
    -Navigate to User>Library>Preferences and delete com.apple.FinalCutPro.plist
    -Navigate to User>Library>Preferences>Final Cut Pro User Data and delete Final Cut Pro 5.0 Prefs
    -Empty your trash
    Relaunch FCP and see if that worked.
    Download FCP Rescue to make this process easier in the future. When you have FCP running really smooth, open FCP Rescue and create a backup of your preference files. If it starts acting wanky, just run FCP Rescue and Restore your backup preferences. Works really slick, and it's free.
    EDIT: Or use the really simple explaination that X posted as I was typing.

  • "Error: Could not complete your request because it is not a valid Photoshop document." How can I fix this on a mac?

    I was working on a project and I closed it after saving and closed photoshop. Then later when I came to make another adjustment to my PSD I opened the file and it said "Could not complete your request because it is not a valid Photoshop document." How can I fix this? I didn't shut off my mac while saving it. Someone please help

    Okay, I just talked to the person that originated the document.
    When this usually happens to me, it's because I've done something stupid like saved a .jpeg as a .psd. So that's what I tried. I tried a few other extensions as well, so I thought that it was not an extension problem. Well, the originator told me it had originally been a TIFF, which was the ONE FILE EXTENSION I DIDN'T TRY. :\
    Anyway, that fixed it. Usually this error indicates either a corrupt file or the wrong extension, just in case anyone ever digs this convo up later.

  • In Mail on my iPhone I have selected show 200 recent messages but only 10 appear how can I fix this?

    Hello,
    I have just recently noticed that in my Mail inbox on my iPhone 5 it is only showing 10 or so previous messages. I have turned my phone on and off, reset mail settings and made sure I have selected show 200 recent messages but still only a few show up. I have also just added my Uni email account to my iPhone and it hasn't loaded any previous emails, it's just an emty mailbox. I really need to be able to search for my previous emails so if someone knows how to fix this please help!

    salsagirljennifer wrote:
    Hi-I got an email saying my icloud was almost full (using 4.8 of 5.0 gb) but when I got to the icloud settings on my iphone it shows I have 200 gb and am only using 19gb. How can I fix this?
    Maybe you have two icloud accounts?

  • When I send my imessage sometimes it tells me that my message is sent as a text message as oppsed to an imessage and then doesnt tell me if its delievered. It just started doing this last night.How can I fix this?

    When I send my imessage sometimes it tells me that my message is sent as a text message as oppsed to an imessage and then doesnt tell me if its delievered. It just started doing this last night.How can I fix this?

    This feature only works with people who have iMessage on their iPhone.  If you are sending a text to someone with a blackberry etc, you will not get the delivery messages.

  • Premiere Pro crashes every time I try to render how can I fix this?

    Premiere Pro
    I'm pretty worried about this.  How can I fix this?
    It is also crashing when I try to apply a motion blur to a small clip.

    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840

  • Since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    A Davey1 wrote:
    Not a nice answer!
    Posting "Check the 'More like this'" area and not simply providing the answer is a great way to make these groups worthless.
    You're ignoring context.  On the old Apple Discussion Groups I never posted replies like that, instead giving people relatively detailed answers.  The new Apple Support Communities made things worse by introducing certain inefficiencies.  Then came Lion.  The flood of messages that came with Lion required a painful choice for any of the people who had been helping here: (1) Give quality responses to a few questions and ignore the rest.  (2) When applicable, give a brief answer such as the one that you found objectionable.  (3) Give up all the other normal activities of life and spend full time trying to answer questions here.
    People who needed help with Lion problems seemed to have trouble discovering existing message threads that described how to solve their problems.  I never posted the suggestion of "Check the 'More like this' area" without verifying that the help that the poster needed could be found there.  Even doing that, what I posted saved me time that I could use to help someone else.
    The people helping here are all volunteers.  None of them is being paid for the time they spend here.  They all have a life outside of Apple Support Communities.  It's arrogant of you to demand that people helping here spend more time than they already do.

  • When I started up itunes on my PC I get this error: a required itunes component is not installed. please repair or reinstall ituens (-42404). How can I fixed this? I uninstalled it at least 6 times. Not exactly sure what I'm suppose to repair either.

    When I started up itunes on my PC I get this error: a required itunes component is not installed. please repair or reinstall ituens (-42404). How can I fixed this? I uninstalled it at least 6 times. Not exactly sure what I'm suppose to repair either. It also says it is syncing my ipod but when I go to disconnect/eject my ipod it says that it is unable to disconnect because files are being used in a program. When it finally disconnects there is no music on my ipod. The gym just ***** with out my ipod. Makes it eiser to not go! Someone please help me!

    Use the instructions here to completely remove/uinstall all iTunes/Apple software and componenets and then start from scratch.
    http://support.apple.com/kb/HT1923
    B-rock

Maybe you are looking for