Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

simple GridBagLayout question

 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I thought I understood GBL, but obviously I dont! -below is a simple piece of code which I thought would give me a blue panel, 200*700 anchored to the north of the frame, which is nearly fullscreen size.
Can anyone tell me why all I get is a tiny blue square in the middle of the screen?!!
Thanks,

Eoin.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change
0.0, 0.0, // weightx, weighty

to
0.5, 0.5, // weightx, weighty

and see what happens
 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael,
That dosnt make any difference. Im really confused! -Ive dropped GBL for now though, I can get sufficiently good results using null layout, so Im going to run with that, seems easier!!
Thanks for your help though.

E
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> That dosnt make any difference.

it does with me - winXP, java 1.5.0_05

it goes from a small square 10x10?, to fill the contentPane 1010x700

note:
myPanel.setSize(200,700);
won't work when subject to a layout manager

> I can get sufficiently good results using null layout,
the 'gotchas' will come back and bite you, but, so be it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic