Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger


Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.awt.applet.Applet;
import java.awt.*;
public class trail extends Applet
public void init()
setLayout(new FlowLayout());
Frame f = new Frame();
Panel p = new Panel();
<applet<br /> Code = ""<br /> height = 600<br /> width = 600<br /> >
this code doesn't compile.It gives the error class awt.applet not found.
if i remove awt from the first line it compiles and executes well.
why does this happens.Is applet not a class of awt package.
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it doesn't compile for a reason. Applet class is not located in awt package but it's in applet package so if you import like this
import java.applet.Applet;
it will compile.
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic