I'm very new to
JAVA... I just wrote an
applet whose init method is as follows:
public void init()
{
f = new Frame("INIT");
f.setSize(400,400);
f.add(this); // this is to add frame to applet....
f.pack();
f.show();
}
When I load this applet in browser or I call init() from main() to just run this program from command prompt mode, the frame that pops will be shrinked (I mean, its size is not getting set according to my setSize(). If I remove pack(), then it works fine. Could anyone please explain why is this happening?
I need to call pack() to add a canvas to the frame, otherwise, canvas will not appear. I'm confused !!!
Thanks for the help in advance,
Vidya.
[ July 31, 2003: Message edited by: Vidya Ram ]