Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Ideas on achieving this using group layout?  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I've been playing about with GroupLayout manager and what I want to achieve is a several componets stacked on top of each other followed by 2 evenly spaced buttons. I'm not quite sure how to achieve this. If you look at the simple example I have below where I'm trying to have a central label followed by 2 evenly spaced buttons but my label is off centre.

Please ignore any variables I have declared and not used.




As you would see, the label is not evenly spaced above the two buttons. I can follow GroupLayout for more regular layouts but this is more awkward. Could someone point me in the right directions please?

Thanks,

Colm
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GroupLayout is designed for UI builders. You can achieve the effect you desire by nesting layouts.
e.g. Have a container with FlowLayout, center aligned.
Add the label.
Create another container. Add buttons to it.
Add this container to the original container.
 
Colm Dickson
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying Maneesh.


Yes I can achieve that using a flow layout on a new panel and adding the buttons and it looks fine. I was just trying to do it using the GroupLayout as I had other items on my GUI designed by hand using Group Layout also.


Colm


 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!