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.