Sidharth
Sidharth

Reputation: 3679

ways to add invisible components into JPanel?

I need to add some invisible component into a JPanel to avoid the issues with grid bag lay out.Which is the best way to add these kind of invisible components?

Upvotes: 0

Views: 1623

Answers (3)

Joey
Joey

Reputation: 354714

You can use the helper methods of the Box class to create such components:

Adding them is done in exactly the same way as you add any other component.

Upvotes: 3

OscarRyz
OscarRyz

Reputation: 199264

Erhmmm you just add them?

Like in:

  jpanel.add( youInvisibleComponent );

???

If you are having problems with the GridBagLayout, you should probably consider using another layout manager :(

Upvotes: 0

ninesided
ninesided

Reputation: 23273

My first question would be "why are you using a GridBayLayout?", have you looked at the alternatives, like GroupLayout?

Upvotes: 0

Related Questions