JFrame does not automatically resizes to JLabel's length
From: Viet Yen Nguyen (vietyen)
Date: 12/24/03
- Previous message: nos: "Re: GUI countdown timer in a JApplet?"
- Next in thread: VisionSet: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: VisionSet: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: Andrew Thompson: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: Viet Yen Nguyen: "Re: JFrame does not automatically resizes to JLabel's length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 24 Dec 2003 20:59:14 +0100
Hi,
I am using three JLabel's on a row using the BorderLayout. The texts of the
JLabel's varies by size, which depends on user input. Unfortunaly, when the
JLabel in the center of the BorderLayout (BorderLayout.CENTER) gets too
large, it gets truncated and appended by three dots (...).
It seems that running pack on JFrame after every JLabel.setText() does solve
the problem, however, it isn't a really clean way because in that case the
JLabel must be aware of the JFrame, which shouldn't be necessary.
So to make a long story short, I would like a way so that the JFrame gets
automatically resized when there is a shortage of space for the components,
without having to call pack().
I have tried to invalidate the JLabel, but that doesn't seem to do it.
Neither changing the LayoutManager, which gives bizarre results.
Thanks in advance,
Viet Yen Nguyen
- Previous message: nos: "Re: GUI countdown timer in a JApplet?"
- Next in thread: VisionSet: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: VisionSet: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: Andrew Thompson: "Re: JFrame does not automatically resizes to JLabel's length"
- Reply: Viet Yen Nguyen: "Re: JFrame does not automatically resizes to JLabel's length"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|