On Wed, 31 Mar 1999, Richard James wrote:

> I am new to java and the 1.2 JDK. I am running RedHat 5.2 and the
> Blackdown JDK1.2-v1pre-release. The install went fine. I have finally
> figured out the libstdc++ link and I can successfully compile command
> line applications.
> 
> However, I am getting the following error on this simple applet. Any
> ideas on how to resolve this.
> 
> [root@localhost java]# cat RootApplet.java
> import java.awt.*;
> 
> public class RootApplet extends com.sun.java.swing.JApplet {

change com.sun.java.swing.JApplet into javax.swing.JApplet
now your code will compile


> int number;
> 
> public void init() {
> number = 225;
> }
> 
> public void paint(Graphics screen) {
> super.paint (screen);
> Graphics2D screen2D = (Graphics2D) screen;
> screen2D.drawString("The square root of " +
> number +
> " is " +
> Math.sqrt(number), 5, 50);
> }
> }
> [root@localhost java]# javac RootApplet.java
> RootApplet.java:3: Superclass com.sun.java.swing.JApplet of class
> RootApplet not found.
> public class RootApplet extends com.sun.java.swing.JApplet {
> ^
> 1 error
> [root@localhost java]#
> 
> Thanks
> Richard James
> 
>  
> 



____________________________________________________
Advanced Technology Group, River Valley Technologies 
URL http://www.river-valley.com
Personal: http://personal.vsnl.com/greenpastures


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to