Hi,
Newbie post - sorry! I can't see the answer around anywhere I don't think
(it's not in the FAQ!).
I'm using GridBagLayout in Java 1.5.
JButton ButtonA's text is originally set to "a very very very long piece of
text". If I then use an actionlistener to do ButtonA.setText("short"); then
ButtonA is resized to just fit "short", and thus changes the rest of my
grid. Is there any way to keep the original proportions, or have I chosen
the wrong layout manager? I'm assuming that my program will always be run
maximised, so I don't have to worry about the screen being resized TOO
much...
Also, I don't suppose there's a simple way to clear a JTextField on mouse
click other than implementing myText.setText(""); with an actionlistener?
Cheers,
Chris
Ben Kaufman - 08 Jun 2005 02:38 GMT
>Hi,
>Newbie post - sorry! I can't see the answer around anywhere I don't think
[quoted text clipped - 14 lines]
>Cheers,
>Chris
Try JTextField.setColums(int n)
Ben