Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "rigid area" and "strut" in Box

Tags:

java

layout

swing

Could someone please explain the differences between

Box.createRigidArea(dimension)

and

Box.createHorizontalStrut(width)

Box.createVerticalStrut(height)

Is "Rigid area" a strut whose both dimensions can be user-specified, or is there more to it?

like image 979
MightyPork Avatar asked Dec 06 '25 04:12

MightyPork


1 Answers

From the tutorial

http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html

It looks like using struts as a filler may present problems when composing different BoxLayouts meanwhile rigid areas are more flexible since they allow you to specify both dimensions.

like image 179
Jorge_B Avatar answered Dec 07 '25 16:12

Jorge_B