Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2007

Tip: Looking for answers? Try searching our database.

IO exceptions problem

Thread view: 
Yuriy_Ivanov - 07 Jan 2007 21:10 GMT
I have an applet class I'm using as a user interface form which adds
labels, textboxes etc, validates the input and handles IO exceptions.

It works fine until I try adding the  IO exceptions.

public class MyTestInterface extends Applet implements ActionListener {

 // All labels etc are declared here
   

 public void init()    {
       
 //  lables etc. added
 
}

 
   public void actionPerformed(ActionEvent e) {

       
// Validation and events here
 
        }
   
   }
     
}

So I'm not sure where to put this:

public static void main(String[] args) throws IOException {

..

}

I'm also trying to convert the input Strings into integers with:
stringX = br.readLine();
variableX = Integer.valueOf(myString).intValue();

But I can't because the main class is causing errors.
hiwa - 07 Jan 2007 23:21 GMT
Use try/catch clause for your IOException.
Andrew Thompson - 07 Jan 2007 23:21 GMT
> I have an applet class ...

Why?  Applets are best lef until you have a good knowledge
of Java, GUI programming, *and* debugging, whereas you are
apparently a beginner.

Did you specifically want something that is web viewable?

Andrew T.
Abhi - 08 Jan 2007 10:32 GMT
Hi,
main method is reqd only for ur console progg. as 4m there only ur
execution starts but 4 an applet exec starts 4m init().so donot use
main and put ur try-catch in start.(or some other method)
Regards...

> I have an applet class I'm using as a user interface form which adds
> labels, textboxes etc, validates the input and handles IO exceptions.
[quoted text clipped - 34 lines]
>
> But I can't because the main class is causing errors.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.