SpringLayout problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alex Ostrikov

    SpringLayout problem

    Hello, all !!!

    Could somebody explain, why my JDialog with SpringLayout doesn't work:

    ....
    public class OptionsDialog extends JDialog
    {
    JLabel label;

    public OptionsDialog()
    {
    Container pane = getContentPane( );

    SpringLayout layout = new SpringLayout();
    pane.setLayout( layout);

    label = new JLabel("Select plugins directory: ");

    pane.add(label) ;

    layout.putConst raint(SpringLay out.WEST, label, 20, SpringLayout.WE ST,
    pane);
    layout.putConst raint(SpringLay out.NORTH, label, 20,
    SpringLayout.NO RTH, pane);

    pack();
    setVisible(true );
    }

    public static void main(String args[])
    {
    OptionsDialog dlg = new OptionsDialog() ;
    }
    }

    Dialog has only title and no even space for label.

    Thanx.


Working...