Problem with first attempt at Swing form

Discussion in 'Java' started by Wes Harrison, Jan 12, 2005.

  1. Wes Harrison

    Wes Harrison Guest

    This is my first attempt at a form using the form designer in NetBeans but
    it doesn't work properly and I can't figure out why. The question is, why
    can't I resize with jSplitPane2 like I can with jSplitPane1? The divider
    bar is frozen in one spot.

    Thanks,

    Wes


    public class NewJFrame extends javax.swing.JFrame {

    /** Creates new form NewJFrame */
    public NewJFrame() {
    initComponents();
    }

    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    */
    private void initComponents() {
    jSplitPane2 = new javax.swing.JSplitPane();
    jPanel2 = new javax.swing.JPanel();
    jTabbedPane2 = new javax.swing.JTabbedPane();
    jButton1 = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jSplitPane1 = new javax.swing.JSplitPane();
    jEditorPane1 = new javax.swing.JEditorPane();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jButton2 = new javax.swing.JButton();
    jComboBox1 = new javax.swing.JComboBox();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jSplitPane2.setAutoscrolls(true);
    jSplitPane2.setContinuousLayout(true);
    jPanel2.setLayout(new java.awt.BorderLayout());

    jButton1.setText("jButton1");
    jTabbedPane2.addTab("tab1", jButton1);

    jPanel2.add(jTabbedPane2, java.awt.BorderLayout.CENTER);

    jSplitPane2.setLeftComponent(jPanel2);

    jPanel1.setLayout(new java.awt.BorderLayout());

    jSplitPane1.setBorder(null);
    jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane1.setAutoscrolls(true);
    jSplitPane1.setContinuousLayout(true);
    jSplitPane1.setLeftComponent(jEditorPane1);

    jButton2.setText("jButton2");
    jTabbedPane1.addTab("tab1", jButton2);

    jTabbedPane1.addTab("tab2", jComboBox1);

    jSplitPane1.setBottomComponent(jTabbedPane1);

    jPanel1.add(jSplitPane1, java.awt.BorderLayout.CENTER);

    jSplitPane2.setRightComponent(jPanel1);

    getContentPane().add(jSplitPane2, java.awt.BorderLayout.CENTER);

    pack();
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new NewJFrame().setVisible(true);
    }
    });
    }

    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    // End of variables declaration

    }
    Wes Harrison, Jan 12, 2005
    #1
    1. Advertising

  2. On Wed, 12 Jan 2005 18:43:08 +1100, Wes Harrison wrote:

    > ..The question is, why
    > can't I resize with jSplitPane2 like I can with jSplitPane1? The divider
    > bar is frozen in one spot.


    At the natural size that the UI appears, I cannot resize either
    JSplitPane (WinXP, Java 1.5.0 beta). Once I make the UI full screen
    I can resize *both* down to (what I assume is) the minimum size of
    the components within them.

    BTW - a better group for this is c.l.j.gui..
    <http://www.physci.org/codes/javafaq.jsp#cljg>

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
    Andrew Thompson, Jan 12, 2005
    #2
    1. Advertising

  3. Wes Harrison

    Wes Harrison Guest

    I should have mentioned that I am using Windows 2000 and Java SE 5.0_01.
    But even when I maximise that window I cannot move the left divider bar
    bigger or smaller. Anyone else experiencing this?

    Wes

    "Andrew Thompson" <> wrote in message
    news:...
    > On Wed, 12 Jan 2005 18:43:08 +1100, Wes Harrison wrote:
    >
    > > ..The question is, why
    > > can't I resize with jSplitPane2 like I can with jSplitPane1? The

    divider
    > > bar is frozen in one spot.

    >
    > At the natural size that the UI appears, I cannot resize either
    > JSplitPane (WinXP, Java 1.5.0 beta). Once I make the UI full screen
    > I can resize *both* down to (what I assume is) the minimum size of
    > the components within them.
    >
    > BTW - a better group for this is c.l.j.gui..
    > <http://www.physci.org/codes/javafaq.jsp#cljg>
    >
    > HTH
    >
    > --
    > Andrew Thompson
    > http://www.PhySci.org/codes/ Web & IT Help
    > http://www.PhySci.org/ Open-source software suite
    > http://www.1point1C.org/ Science & Technology
    > http://www.LensEscapes.com/ Images that escape the mundane
    Wes Harrison, Jan 12, 2005
    #3
    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. Andrea Fino

    a first attempt

    Andrea Fino, Apr 24, 2004, in forum: HTML
    Replies:
    0
    Views:
    426
    Andrea Fino
    Apr 24, 2004
  2. The White Lady

    first attempt at webpage

    The White Lady, May 13, 2004, in forum: HTML
    Replies:
    15
    Views:
    643
    Mark Parnell
    May 18, 2004
  3. ThLog
    Replies:
    6
    Views:
    356
    Travis Newbury
    Mar 2, 2006
  4. Robin Siebler

    My first attempt at subclassing....Gahh!

    Robin Siebler, Sep 14, 2004, in forum: Python
    Replies:
    7
    Views:
    410
    Alex Martelli
    Sep 14, 2004
  5. GMI
    Replies:
    3
    Views:
    495
    Tad McClellan
    Jun 19, 2005
Loading...

Share This Page