No Box.createRigidArea .. In NetBeans Toolbox

Discussion in 'Java' started by clusardi2k@aol.com, Apr 8, 2013.

  1. Guest

    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,
    , Apr 8, 2013
    #1
    1. Advertising

  2. Lew Guest

    wrote:
    > 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?

    --
    Lew
    Lew, Apr 8, 2013
    #2
    1. Advertising

  3. markspace Guest

    On 4/8/2013 2:19 PM, 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 find them (it's a ways).
    markspace, Apr 8, 2013
    #3
  4. markspace Guest

    On 4/8/2013 3:15 PM, markspace wrote:
    > On 4/8/2013 2:19 PM, 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.


    "Palette." Argh.
    markspace, Apr 8, 2013
    #4
  5. Guest

    On Monday, April 8, 2013 6:15:15 PM UTC-4, markspace wrote:
    > On 4/8/2013 2:19 PM, 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,
    , Apr 10, 2013
    #5
  6. markspace Guest

    On 4/9/2013 6:23 PM, wrote:
    >
    > 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.
    markspace, Apr 10, 2013
    #6
  7. In article <kk2lud$ev1$>,
    markspace <> wrote:

    > On 4/9/2013 6:23 PM, wrote:
    > >
    > > 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.


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

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Apr 10, 2013
    #7
  8. Guest

    On Wednesday, April 10, 2013 10:55:36 AM UTC-4, John B. Matthews wrote:
    > In article <kk2lud$ev1$>, markspace <> wrote: > On 4/9/2013 6:23 PM, wrote: > > > > 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. Same in 7.3. Swing Fillers may be easier to spot if the other tree nodes are closed. -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>


    I have an older version of NetBeans.

    Thanks,
    , Apr 10, 2013
    #8
  9. Guest

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

    Thanks,
    , Apr 10, 2013
    #9
  10. Guest

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

    Thanks,
    , Apr 10, 2013
    #10
  11. In article <>,
    wrote:

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


    Not as far as I know.
    John B. Matthews, Apr 10, 2013
    #11
  12. Guest

    , Apr 11, 2013
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Prasanna Padmanabhan

    add custom control to toolbox

    Prasanna Padmanabhan, Jul 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,620
    Prasanna Padmanabhan
    Jul 3, 2003
  2. Pimousse
    Replies:
    2
    Views:
    3,622
    Roedy Green
    Apr 21, 2004
  3. Ilias Lazaridis
    Replies:
    0
    Views:
    899
    Ilias Lazaridis
    Dec 12, 2004
  4. Gnarlodious
    Replies:
    4
    Views:
    17,566
    elizas
    May 5, 2010
  5. Thomas G. Marshall
    Replies:
    2
    Views:
    816
    Thomas G. Marshall
    Oct 16, 2006
Loading...

Share This Page