• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

arranging display in a panel with grid bags...

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
I have done a setLayout(new GridLayout(2,2)) in order to get 4 panels. 2 rows by 2 columns.
In the row1/col1 (NORTHWEST) is a block of data in tabular format.
In the row1/col2 there should be an image.
In row2 there should be a text area spanning both columns.
Somehow, my current arrangement has got a bit of the image displayed on the right hand side of row 2 text area.
How do I force the image to display in a panel in row1/col2 ???
Yes doing it right the first time is diffcult, after that, I get remarks from colleagues reading and copying my codes, saying "...that looks easy, I knew that... ".
***************
Basically, if I have a 3x4 grid than how do I ensure that panel ABC is in row1, col2 ???
***************
Arrrgggh, all these books have such simple examples, like setLayout(new GridLayout(1,2)).

[ December 10, 2002: Message edited by: achana chan ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of using GridLayout, you should be using GridBagLayout...

Here's a short example showing a frame layed out like you described...

 
Die Fledermaus does not fear such a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic