Results 1 to 5 of 5
- 11-13-2010, 05:50 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 7
- Rep Power
- 0
Which layout to use for this design?
hi everyone,
this is my desired design
JLabel1 //no JTextField here, textfield start on row 2
JLabel2 JTextField1
JLabel3 JTextField2
... //all are the same after JLabel3
this can be expand until JLabel 100.. first row must start at top left corner..
no vertical empty space between JLabel even the panel is resized...
i've tried to put all these components into 1 JPanel with gridbaglayout but the output is not good.. although can start at top left corner but i cannot delete the empty spaces after JLabel1...
or maybe u guys got better layout??
Thank you!
-
GridBagLayout should work fine, just make sure to place an invisible component such as an empty JLabel in the upper right corner where you state there should be no JTextField. If it still doesn't work, post an SSCCE here and let's take a look at it.
Luck!
- 11-13-2010, 07:07 PM #3
No need for an invisible component. colspan = 2 will suffice for the JLabel in the first row.
One way to do that is to give the last row a nonzero weighty, fill of NONE and anchor of NORTH. All other rows should have a weighty = 0.no vertical empty space between JLabel even the panel is resized...
db
- 11-13-2010, 07:40 PM #4
Member
- Join Date
- Nov 2010
- Posts
- 7
- Rep Power
- 0
- 11-13-2010, 07:43 PM #5
Member
- Join Date
- Nov 2010
- Posts
- 7
- Rep Power
- 0
Similar Threads
-
Please Help me to do a layout
By neway003 in forum AWT / SwingReplies: 3Last Post: 11-03-2010, 06:28 PM -
looking for a layout
By imorio in forum AWT / SwingReplies: 3Last Post: 08-13-2010, 05:02 PM -
Edit layout Layout please help me
By manhtungtnk28@gmail.com in forum New To JavaReplies: 4Last Post: 11-23-2009, 08:41 AM -
Layout manager
By Nicholas Jordan in forum Java AppletsReplies: 2Last Post: 11-24-2008, 03:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks