Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

define java BoxLayout, Box

boxl = new BoxLayout(p, dir); Creates layout for container p. dir is BoxLayout.X_AXIS BoxLayout.Y_AXIS. Note: must have already created p.
box = new Box(dir); Creates a Container with vertical or horizontal layout.

p.add(widget); Adds widget to the next position.

These static Box methods create useful spacing components, which can be used in other layouts.

Box.createVerticalStrut(n) Creates a vertical spacer n pixels high.

Box.createHorizontalStrut(n) Creates a horizontal spacer n pixels wide.

Box.createRigidArea(dim) Spacer with width and height. dim is Dimension object, eg, new Dimension(10, 0).

Box.createHorizontalGlue() Creates expandable horizontal space.

Box.createVerticalGlue() Creates expandable vertical space.

new Box.Filler(mn,prf,mx) Creates a Box.Filler with min, preferred, and max sizes, each is Dimension object.

No comments:

Post a Comment

Archives