I am trying to create a group layout that looks like this:
JLabel JTextField
JLabel JComboBox
For some reason when I run it, they are all on one line..
JLabel depthLabel = new JLabel("Recursive Depth: "); JTextField depthText = new JTextField(2); JLabel color1Label = new JLabel ("Color 1: "); String[] colors = { "Blue", "Cyan", "Dark Gray", "Gray", "Green" }; JComboBox color1 = new JComboBox(colors); buttonLayout.setAutoCreateGaps(true); buttonLayout.setAutoCreateContainerGaps(true); GroupLayout.SequentialGroup hSeqGroup = buttonLayout.createSequentialGroup(); GroupLayout.SequentialGroup vSeqGroup = buttonLayout.createSequentialGroup(); GroupLayout.ParallelGroup hParGroup1 = buttonLayout.createParallelGroup(); GroupLayout.ParallelGroup hParGroup2 = buttonLayout.createParallelGroup(); hParGroup1.addComponent(depthLabel); hParGroup2.addComponent(depthText); hParGroup1.addComponent(color1Label); hParGroup2.addComponent(color1); hSeqGroup.addGroup(hParGroup1); hSeqGroup.addGroup(hParGroup2); GroupLayout.ParallelGroup vParGroup = buttonLayout.createParallelGroup(); GroupLayout.ParallelGroup vParGroup2 = buttonLayout.createParallelGroup(); vParGroup.addComponent(depthLabel); vParGroup.addComponent(depthText); vParGroup2.addComponent(color1Label); vParGroup2.addComponent(color1); vSeqGroup.addGroup(vParGroup); vSeqGroup.addGroup(vParGroup2); buttonLayout.setHorizontalGroup(hSeqGroup); buttonLayout.setVerticalGroup(vSeqGroup);