• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

resizing without using gridbaglayout

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey guys we've been using gridbaglayout in class now for quite sometime now, and everyone including the professor thinks its overly complicated. I have now one question. When using gridbaglayout its possible to set the variables to let specific panels stretch horizontally and vertically. Is it possible to do this without using gridbagLayout. My professor sais it is, but that its more complicated? someone please tell me he's wrong? and if so, how would i go about doing so?
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just a matter of putting the components into nested JPanels - each panel a
different layoutManager
e.g a label next to a textField
set the panel as a BorderLayout
put the label in WEST
put the textfield in CENTER
now, when the frame/panel is stretched wider, the label will remain the same,
while the textfield stretches

its only complicated if you don't know how - just like a gridbaglayout

more info
http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html
reply
    Bookmark Topic Watch Topic
  • New Topic