🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by Jim Sun, 11 Apr 2004 15:07
How to keep textfield size at 1 character height
#1126
Author: Jim
Date: Sun, 11 Apr 2004 15:07
25 lines
1781 bytes
I'm trying to layout a series pairs of labels (JLabel) and text fields
(JTextfield) for a form.

Is there an easy way of doing this and constraining the height of the
textfield to be 1 character height?
Ideally, I could just plunk down a text field and have it be the right
height (with a border would be nice) regardless of its container and layout
style.

I've tried a 2-column grid with labels on the left and textfields on the
right and the textfield gets resized
whenever the grid is resized.  Trying two side-by-side panels with vertical
box layouts doesn't work either.

Putting the textfield on its own JPanel keeps the textfield a constant size
but this seems like overkill.

Is subclassing a JTextfield (or a JPanel with JTextfield) so I don't have
set each one up individually a solution?

I'm using JBuilder Foundation IDE.

Thanks for your suggestions.

Jim Cant
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads