Boxlayout - align things to the right?
I have a Box setup with PAGE_AXIS layout.. The Box will contain several JLabel icons (no text) and will be wider than the icons combines. I want the extra space to appear on the left side instead of the right. How do I add this?
I've tried adding Box.createHorizontaGlue() as the first thing but that doesnt help.
FYI, this container will implement TableCellRenderer
So like this:
[ .........................[ ] [ ][ ][ ][ ][ ][ ]|
AdvertisementAs already mentioned in a boxLayout you have to set the alignment of each child to get the overall alignment. While that's acceptable in a small container, it can get boring in a bigger environment. So in the long run you might consider switching to more powerful LayoutManager like JGoodies FormLayout (http://forms.dev.java.net/): it lets you define component alignment on a per-column/row basis.
Personally I switched completely to FormLayout (from nested BoxLayouts which are not too bad, IMO) and developed a visual builder for it (http://swingempire.de/palace/FormBuilder) <g>
- 1Setting dynamic mehod in an attribute 10-11
- 2Using avi files with DVpal. Working with screen grab footage. 10-11
- 3Tomcat, Apache, mod_webapp and reloadable 11-30
- 4Check if app window is visible 11-30
- 5Date in a field 11-30
- 6Steps for Refresh the Test Database with cold-backup 11-30
- 7IDVD won't run with my iMac PPC G5 11-30
- 8Rapid Overheating of CPUs/Lower Fan Won't come On 11-30
- Apple id no longer exists10/11
- Installing Windows XP on Satellite L40-11410/11
- I have Itunes already, but when i connect my Iphone to my Computer it say Iphone mobile device service is not started, what should I do?11/30
- How to add a gui status in selection screen11/30
- Interpreting a call stack traceback11/30
- PROBLEM IN DOWNLOADING PHOTOSHOP11/30
- Document type change during fee calculation11/30
- 8520 device is locked11/30
- Is there a way to remove the autoformatting of the "Places" slideshow theme?11/30
- Line 2 Is Causing Big Problems!11/30