[5803] in java-interest
Re: HELP - Extending the Applet class
daemon@ATHENA.MIT.EDU (dc)
Tue Feb 27 03:55:08 1996
Date: Mon, 26 Feb 1996 23:18:54 -0800
To: Mike Wooding <woodinmi@earthlink.net>
From: dc <dc@symbolicsoft.com>
Cc: java-interest@java.sun.com
//java.lang.NoClassDefFoundError: OptionPanel
Think i know what the problem is.
There is some points that the lang says each class should be in a separate
file, but the compiler will actually accept private classes within the same
file - but not public - this may be why the app is compiling but not running.
Note your first class is not declared public.
So 'page1' could get access to 'optionpanel' but not the other way around!
However, I would have thought the compiler would have given an error - 'cant
find constructor for page1' or whatever, in the place where you try and
instance it; unless that's in the same file too! (or have you tried that yet?)
Also note you have declared the array but not its limits. I've had hiccups
with this, not sure the exact reality, but thin you need to declare how big
an array is initially, and it remains static:
Button b[] = new Button[MAX_BUTTONS]; // Array of unknown number of buttons
you could look at the Vector class if you want dynamic allocation, but I
haven't been there yet!
dc
___________________________________________________________________
/\ dave 'dc' collier
/_/\ Symbolic Software, Inc.
/_\_ \ dc@SymbolicSoft.com
/___/__\ tel (415) 546 1295
use your Head or lose your Mind! http://www.BurnCycle.com
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com