How heavy is a JPanel?

T

Timasmith

In terms of performance not pounds, when it comes to layout managers,
resources et al.

As an example I want to have a comboxbox and an elipsis ... button
treated as a single control.

If I use a JPanel + BorderLayout with a combobox using the 'Center' and
the button the 'East'

[________] [...]

To make it look good I dont want the button to take up the entire East,
rather be laid out in a 'Flowlayout' fashion. To achieve this I need
to add an extra JPanel.

Will that add much overhead if I have forms with 10-20 comboboxes
routinely displayed?
 
M

Michael Rauscher

Timasmith said:
As an example I want to have a comboxbox and an elipsis ... button
treated as a single control.

If I use a JPanel + BorderLayout with a combobox using the 'Center' and
the button the 'East'

[________] [...]

To make it look good I dont want the button to take up the entire East,
rather be laid out in a 'Flowlayout' fashion. To achieve this I need
to add an extra JPanel.

No, you need not. You simply need another LayoutManager. Try JGoodies
FormsLayout e.g.
Will that add much overhead if I have forms with 10-20 comboboxes
routinely displayed?

Sure, but I'm unsure if you can see or feel this overhead while running :)

Bye
Michael
 
P

Peter Van Weert

Michael Rauscher schreef:
Sure, but I'm unsure if you can see or feel this overhead while running :)

I agree with Michael. It's like another Michael once said (no, no, not
that one...):

"The First Rule of Program Optimization: Don't do it. The Second Rule of
Program Optimization (for experts only!): Don't do it yet."
- Michael A. Jackson

CHeeRs,
Peter
 
F

Fred Kleinschmidt

Timasmith said:
In terms of performance not pounds, when it comes to layout managers,
resources et al.

As an example I want to have a comboxbox and an elipsis ... button
treated as a single control.

If I use a JPanel + BorderLayout with a combobox using the 'Center' and
the button the 'East'

[________] [...]

To make it look good I dont want the button to take up the entire East,
rather be laid out in a 'Flowlayout' fashion. To achieve this I need
to add an extra JPanel.

Will that add much overhead if I have forms with 10-20 comboboxes
routinely displayed?
The easiest way to do this is to write your own EllipsisCombo component,
extending JPanel, and containing a JComboBox and a JButton that you
place explicitly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top