Re: ComboBox width before setVisible??
- From: Michael Rauscher <michlmann@xxxxxx>
- Date: Tue, 26 Sep 2006 13:09:35 +0200
Paulo Filipe schrieb:
HI
I'm using a comboBox and need to know his size before i set the frame
visible, i did more or less this code:
JFrame frame = new Frame();
............
JComboBox combo = new JComboBox( {"small text","a more long text"} );
combo.setSelectedIndex(0);
...........
int x = combo.getWidth(); // x is 0 here.
frame.setVisible();
int y = combo.getWidth(); // y is the size of the comboBox with the
option "a more long text"
But i want to know his width before to resize a panel.
Anyone knows how can i do it??
See getPreferredWidth.
Bye
Michael
.
- Follow-Ups:
- Re: ComboBox width before setVisible??
- From: Paulo Filipe
- Re: ComboBox width before setVisible??
- References:
- ComboBox width before setVisible??
- From: Paulo Filipe
- ComboBox width before setVisible??
- Prev by Date: ComboBox width before setVisible??
- Next by Date: Re: panel size vs. frame size
- Previous by thread: ComboBox width before setVisible??
- Next by thread: Re: ComboBox width before setVisible??
- Index(es):
Relevant Pages
|