posted 20 years ago
I have been having a problem with easily getting multiple pairs of labels and text fields on a JFrame. Not actually a problem, but a hassle. If I want this -
My Label ----Text Field----
Anthr Lbl ----Text Field----
Third Lbl ----Text Field----
(Thats really rough ASCII'ish art!)
I find myself having to do one of 2 things -
- Create a panel and set its layout manager to gridbag or grid, then add each pair of components
- Create a panel and set the manager to box layout, then create a sub-panel for each label/text field pair using a flow layout
My solution is to create a custom JComponet, which has a label and a text field combined. It has to at least act this way, internally it can be whatever works best.
Does anyone have any suggestions for how to implement this?
Can I do it by actually using a label and text field internally?
All help appreciated!
Regards,
Aaron R>
[ December 29, 2003: Message edited by: Aaron Roberts ]