• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sample code-Pl. help me!

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
HEre is my code for Swing 1.1:
Please let me know what's wrong here:
import java.awt.*;
import com.sun.java.swing.*;
public class TestApplet extends JApplet{
public TestApplet()
{
}
public void init(){
setSize(100,100);
Panel topPanel = new Panel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel);
Label l = new Label("Hello World!");
topPanel.add(l,BorderLayout.NORTH);
}
}
Thanks in advance,
Angela
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Angela
What are you trying to do with this code. It gave me one error for JApplet API not found and I included that and recompiled it.
Got the JApplet with Hello World right at the top.

Please do get back.
Regards
Suneel
[This message has been edited by Suneel Setlur (edited January 23, 2001).]
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suneel,
Thanks for your response.
How did solve error in code? B'cos the code you send me is still not compiling with JDK1.1.8. Please give me the code(my code) you solved and compliled it..
Thanks again
Angela
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suneel,
when I compiled the code with JDK1.1.8,it's giving me following error:
TestApplet.java:2: Package javax.swing not found in import.
import javax.swing.*;
^
TestApplet.java:3: Package com.sun.java.swing not found in import.
import com.sun.java.swing.*;
^
TestApplet.java:6: Superclass JApplet of class TestApplet not found.
public class TestApplet extends JApplet{
^
Please help me out,
Thanks,
Angela
 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Angela
Forgot to mention, I used JDK1.2.2.
For 1.1.8 set classpath to swingall.jar which is there in the jdk directory.
Regards
Suneel
[This message has been edited by Suneel Setlur (edited January 24, 2001).]
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem Suneel,
My Aim to run swing applet without HTML converter and Java plugins. That' why i am using Swing1.1. Do u have any simple example from swing1.1.8, so I can run without HTML converter.
Please let me know,
Thanks again,
Angela
Originally posted by Suneel Setlur:
Sorry Angela
Forgot to mention, I used JDK1.2.2.
Regards
Suneel

 
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry again Angela.....
Posted a part of it and was editing it when you replied.
If you see the reply once again. I guess you'll get it
Regards
Suneel
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry Suneel. I got it.
Thanks for your responses.
But I couln't find out Swingall.jar in my JDK1.1.8 directory.
Please let me know,
Thanks
Angela
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!