No Box.createRigidArea .. In NetBeans Toolbox

C

clusardi2k

I don't think that "Box" is a control in the NetBeans toolbox.

Consequently, I'd like to simulate the following lines of code.

Question: How do I do it?


JPanel MyPanel;

MyPanel.add(Box.createRigidArea(new Dimensions 20,25));
MyPanel.add. ...


MyPanel.add(Box.createHorizontalGlue());


Thanks,
 
L

Lew

I don't think that "Box" is a control in the NetBeans toolbox.

IIRC you can add components to the toolbox.
Consequently, I'd like to simulate the following lines of code.

Question: How do I do it?

Type it in directly?
JPanel MyPanel;

Variable names are supposed to begin with a lower-case letter.
MyPanel.add(Box.createRigidArea(new Dimensions 20,25));

This doesn't throw a 'NullPointerException' for you?

It should.
MyPanel.add. ...

MyPanel.add(Box.createHorizontalGlue());

Why would you add that to the panel?
 
M

markspace

Question: How do I do it?
JPanel MyPanel;

MyPanel.add(Box.createRigidArea(new Dimensions 20,25));

You have to select BoxLayout on your panel form first. Then the rigid
separators and glue appear on the Pallet. Scroll down to Swing Filler
to find them (it's a ways).
 
C

clusardi2k

On 4/8/2013 2:19 PM, (e-mail address removed) wrote: > Question: How do I do it? > JPanel MyPanel; > > MyPanel.add(Box.createRigidArea(new Dimensions 20,25)); You have to select BoxLayout on your panel form first. Then the rigid separators and glue appear on the Pallet. Scroll down to Swing Filler to findthem (it's a ways).

I tried following these steps exactly, but I couldn't find "Swing Filler". The closest thing that I found was "Separator".

Why am I not seeing "Swing Filler".

Thanks,
 
M

markspace

I tried following these steps exactly, but I couldn't find "Swing
Filler". The closest thing that I found was "Separator".

Why am I not seeing "Swing Filler".


Beats me. I'm using NetBeans 7.2, if that helps. I see two separators
in the Palette, one is under Swing Controls and the other is under Swing
Menus. Keeps scrolling, it's further down than either.
 
J

John B. Matthews

markspace said:
Beats me. I'm using NetBeans 7.2, if that helps. I see two
separators in the Palette, one is under Swing Controls and the
other is under Swing Menus. Keeps scrolling, it's further down
than either.

Same in 7.3. Swing Fillers may be easier to spot if the other tree
nodes are closed.
 
C

clusardi2k

Are "Swing Fillers" 3rd party controls? Do get them do I have to download them from the Internet.

Thanks,
 
C

clusardi2k

Are "Swing Fillers" 3rd party controls? To get them, do I have to download them from the Internet.

Thanks,
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top