How to run applet in ubuntu or linux
After import statement just add this line in your applet /*<applet code ="appletwelcome" width=100 height =300></applet>*/ Here is the sample applet source code //Applet displaying welcome import java.applet.*; import java.awt.*; /*<applet code ="appletwelcome" width=100 height =300></applet>*/ public class appletwelcome extends Applet { public void init() { setBackground(Color.red); } public void paint(Graphics g) { String msg="welcome"; g.drawString(msg,10,10); } }