Новичок
Профиль
Группа: Участник
Сообщений: 15
Регистрация: 17.11.2008
Репутация: нет Всего: нет
|
| Код | import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import javax.swing.table.*;
public class Main {
protected JPanel MainWindows; protected JPanel panel7; protected JPanel hSpacer21; protected JComboBox comboBox5; protected JPanel hSpacer22; protected JComboBox comboBox6; protected JPanel hSpacer23; protected JComboBox comboBox7; protected JPanel hSpacer24; protected JComboBox comboBox8; protected JPanel hSpacer25; protected JButton saveControl; protected JPanel hSpacer26; protected JComboBox comboBox21; protected JPanel hSpacer27; protected JComboBox comboBox22; protected JPanel hSpacer28; protected JComboBox comboBox23; protected JPanel hSpacer29; protected JComboBox comboBox24; protected JPanel hSpacer30; protected JPanel hSpacer31; protected JComboBox comboBox25; protected JPanel hSpacer32; protected JComboBox comboBox26; protected JPanel hSpacer33; protected JComboBox comboBox27; protected JPanel hSpacer34; protected JComboBox comboBox28; protected JPanel hSpacer35; protected JPanel hSpacer36; protected JComboBox comboBox29; protected JPanel hSpacer37; protected JComboBox comboBox30; protected JPanel hSpacer38; protected JComboBox comboBox31; protected JPanel hSpacer39; protected JComboBox comboBox32; protected JPanel hSpacer40; protected JScrollPane scrollPane1; protected JTable resultTable; protected JPanel panel1; protected JButton startControl; protected JButton stopControl; protected JPanel hSpacer4;
private void initComponents() { MainWindows = new JPanel(); panel7 = new JPanel(); hSpacer21 = new JPanel(null); comboBox5 = new JComboBox(); hSpacer22 = new JPanel(null); comboBox6 = new JComboBox(); hSpacer23 = new JPanel(null); comboBox7 = new JComboBox(); hSpacer24 = new JPanel(null); comboBox8 = new JComboBox(); hSpacer25 = new JPanel(null); saveControl = new JButton(); hSpacer26 = new JPanel(null); comboBox21 = new JComboBox(); hSpacer27 = new JPanel(null); comboBox22 = new JComboBox(); hSpacer28 = new JPanel(null); comboBox23 = new JComboBox(); hSpacer29 = new JPanel(null); comboBox24 = new JComboBox(); hSpacer30 = new JPanel(null); hSpacer31 = new JPanel(null); comboBox25 = new JComboBox(); hSpacer32 = new JPanel(null); comboBox26 = new JComboBox(); hSpacer33 = new JPanel(null); comboBox27 = new JComboBox(); hSpacer34 = new JPanel(null); comboBox28 = new JComboBox(); hSpacer35 = new JPanel(null); hSpacer36 = new JPanel(null); comboBox29 = new JComboBox(); hSpacer37 = new JPanel(null); comboBox30 = new JComboBox(); hSpacer38 = new JPanel(null); comboBox31 = new JComboBox(); hSpacer39 = new JPanel(null); comboBox32 = new JComboBox(); hSpacer40 = new JPanel(null); scrollPane1 = new JScrollPane(); resultTable = new JTable(); panel1 = new JPanel(); startControl = new JButton(); stopControl = new JButton(); hSpacer4 = new JPanel(null);
{ MainWindows.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "MAIN", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), MainWindows.getBorder())); MainWindows.addPropertyChangeListener(new java.beans.PropertyChangeListener(){ public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
MainWindows.setLayout(new BoxLayout(MainWindows, BoxLayout.Y_AXIS));
{ panel7.setLayout(new GridBagLayout()); ((GridBagLayout)panel7.getLayout()).columnWidths = new int[] {5, 100, 0, 100, 0, 100, 0, 100, 14, 101, 0}; ((GridBagLayout)panel7.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0}; ((GridBagLayout)panel7.getLayout()).columnWeights = new double[] {0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0E-4}; ((GridBagLayout)panel7.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4}; panel7.add(hSpacer21, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
comboBox5.setPrototypeDisplayValue("1231233123"); panel7.add(comboBox5, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer22, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox6, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer23, new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox7, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer24, new GridBagConstraints(6, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
comboBox8.setModel(new DefaultComboBoxModel(new String[] { "\u041f\u043e\u043b\u0435 4" })); panel7.add(comboBox8, new GridBagConstraints(7, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer25, new GridBagConstraints(8, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
saveControl.setText("\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"); saveControl.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { saveControlActionPerformed(e); } }); panel7.add(saveControl, new GridBagConstraints(9, 1, 1, 4, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer26, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
comboBox21.setPrototypeDisplayValue("1231233123"); panel7.add(comboBox21, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer27, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox22, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer28, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox23, new GridBagConstraints(5, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer29, new GridBagConstraints(6, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox24, new GridBagConstraints(7, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer30, new GridBagConstraints(8, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer31, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
comboBox25.setPrototypeDisplayValue("1231233123"); panel7.add(comboBox25, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer32, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox26, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer33, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox27, new GridBagConstraints(5, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer34, new GridBagConstraints(6, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox28, new GridBagConstraints(7, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer35, new GridBagConstraints(8, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer36, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
comboBox29.setPrototypeDisplayValue("1231233123"); panel7.add(comboBox29, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer37, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox30, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer38, new GridBagConstraints(4, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox31, new GridBagConstraints(5, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer39, new GridBagConstraints(6, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(comboBox32, new GridBagConstraints(7, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); panel7.add(hSpacer40, new GridBagConstraints(8, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } MainWindows.add(panel7);
{
//resultTable resultTable.setModel(new DefaultTableModel( new Object[][] { }, new String[] { null, null, null, null, null, null } ) { Class<?>[] columnTypes = new Class<?>[] { String.class, Object.class, Object.class, Object.class, Object.class, Object.class }; @Override public Class<?> getColumnClass(int columnIndex) { return columnTypes[columnIndex]; } }); scrollPane1.setViewportView(resultTable); } MainWindows.add(scrollPane1);
{ panel1.setBorder(new MatteBorder(1, 1, 1, 1, Color.black)); panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
startControl.setText("\u0421\u0442\u0430\u0440\u0442"); startControl.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { startControlActionPerformed(e); } }); panel1.add(startControl);
stopControl.setText("\u0421\u0442\u043e\u043f"); stopControl.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { stopControlActionPerformed(e); } }); panel1.add(stopControl); panel1.add(hSpacer4); } MainWindows.add(panel1); } }
private void saveControlActionPerformed(ActionEvent e) { //действие }
private void startControlActionPerformed(ActionEvent e) { // действие }
private void stopControlActionPerformed(ActionEvent e) { // действие } }
|
дальше думаю доделаешь ;) Это сообщение отредактировал(а) lowolf - 19.11.2010, 20:53
|