user3352349
user3352349

Reputation: 177

GridBagLayout: component in multiple grid squares

Is it possible to have a single JComponent spread over multiple grid squares, and if so how would I achieve this?

Upvotes: 0

Views: 119

Answers (1)

Braj
Braj

Reputation: 46861

Yes its possible.

Read more about How to Use GridBagLayout and find sample code as well.

In below screenshot Long-Named Button 4 is spread across 3 columns and 5 in spread across 2 columns.

enter image description here

Upvotes: 4

Related Questions