• Post Reply Bookmark Topic Watch Topic
  • New Topic

Frame  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
inside public static void main i am setting
Frame f=new Frame();
f.setSize(800,300).
In constructor of that frame ,i can't able to get Dimesion,it is giving width=0,height=0.What is Solution.
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cud u please post ur code with output/error
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
it is obvious isn't it. u r setting the size of the frame only after the return from the constructor. so the size of the frame will be 0,0 in the constructor. only after it returns from the constructor will be size be set at 800,300.after the command setSize in the main method.
Rahul
[This message has been edited by rahul_mkar (edited June 08, 2000).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!