Problem with first attempt at Swing form

W

Wes Harrison

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

}
 
A

Andrew Thompson

..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
 
W

Wes Harrison

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
 

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,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top