Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Absence of initial display of swing components  RSS feed

 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Question is the code is working and RUNNING. But all the combobox are not displayed initially. Only the first two combo box, label and the button are displayed. When I click on the Maximize button of the frame window it displays all the components. What could be the mistake? I'm bewildered!
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I generally avoid calling "setSize", and instead call "pack". I think it's preferable to have Swing size and lay out the components freely. Do the missing components fit into the initial size?
 
Sandeep Swaminathan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey ulf,

the thing is I want it to be 1024*768(full-screen) and that is why I'm setting the size and not packing. Is there any other way to do that?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> the thing is I want it to be 1024*768(full-screen) and that is why I'm setting the size and not packing. Is there any other way to do that?

identify the problem first.
do the components appear using pack()?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!