private void DetailSizeCheckBoxActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_DetailSizeCheckBoxActionPerformed if (!DetailSizeCheckBox.isSelected()) { // select the volume checkbox VolumeCheckBox.setSelected(true); // enable the volume text field VolumeTF.setEnabled(true); VolumeLabel.setText("* Volume : "); // disable the detail of size text field LengthTF.setText(""); LengthTF.setEnabled(false); LengthLabel.setText("Length : "); WidthTF.setText(""); WidthTF.setEnabled(false); WidthLabel.setText("Width : "); HeightTF.setText(""); HeightTF.setEnabled(false); HeightLabel.setText("Height : "); } else { // dis-select the volume checkbox VolumeCheckBox.setSelected(false); VolumeLabel.setText("Volume : "); // empty the volume text field and disable it VolumeTF.setText(""); VolumeTF.setEnabled(false); // reenable the detail of size text field LengthTF.setEnabled(true); LengthLabel.setText("* Length : "); WidthTF.setEnabled(true); WidthLabel.setText("* Width : "); HeightTF.setEnabled(true); HeightLabel.setText("* Height : "); } } // GEN-LAST:event_DetailSizeCheckBoxActionPerformed
private void OKActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_OKActionPerformed // the tabbed pane final int item = 0; final int additional = 1; final int prodandsel = 2; // get data from dialog text field String name = nameTF.getText().trim(); String itemcode = itemCodeTF.getText().trim(); String buyingprice = buyingPriceTF.getText().trim(); String saleprice = salePriceTF.getText().trim(); String comment = commentTA.getText(); String primary = PrimaryTF.getText().trim(); String secondary = SecondaryTF.getText().trim(); String category = categoryTF.getText().trim(); String length, width, height, volume; Integer intvolume, intlength, intwidth, intheight; String measurement = MeasurementTF.getText().trim(); String producer = (String) ProducerCoB.getSelectedItem(); String secondarythirdmeasurement = SecondaryThirdMeasurementTF.getText().trim(); String third = ThirdTF.getText().trim(); // make sure the required fields are not null if (itemcode.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Item Code Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(item); itemCodeTF.requestFocusInWindow(); return; } if (category.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Category Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(item); categoryTF.requestFocusInWindow(); return; } if (name.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Name Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(item); nameTF.requestFocusInWindow(); return; } if (buyingprice.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Buying Price Text " + "Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(item); buyingPriceTF.requestFocusInWindow(); return; } int intbuyingprice = Integer.parseInt(buyingprice); if (saleprice.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Sale Price Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(item); salePriceTF.requestFocusInWindow(); return; } int intsaleprice = Integer.parseInt(saleprice); // if user fill the volume if (VolumeCheckBox.isSelected()) { volume = VolumeTF.getText().trim(); if (volume.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Volume Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); VolumeTF.requestFocusInWindow(); return; } intvolume = Integer.parseInt(volume); intlength = null; intwidth = null; intheight = null; } else { length = LengthTF.getText().trim(); if (length.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Length Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); LengthTF.requestFocusInWindow(); return; } width = WidthTF.getText().trim(); if (width.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Width Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); WidthTF.requestFocusInWindow(); return; } height = HeightTF.getText().trim(); if (height.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Height Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); HeightTF.requestFocusInWindow(); return; } intlength = Integer.parseInt(length); intwidth = Integer.parseInt(width); intheight = Integer.parseInt(height); intvolume = intlength * intwidth * intheight; } if (primary.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Primary Measurement " + "Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); PrimaryTF.requestFocusInWindow(); return; } if (secondary.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Secondary Measurement " + "Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); SecondaryTF.requestFocusInWindow(); return; } if (measurement.equals("")) { JOptionPane.showMessageDialog( null, "Please insert the Measurement " + "Text Field!", "Warning", JOptionPane.WARNING_MESSAGE); ItemTabbedPane.setSelectedIndex(additional); MeasurementTF.requestFocusInWindow(); return; } // check if it is the valid name String oldname = (String) table.getModel().getValueAt(row, 2); if (!st.UpdateValidName(oldname, name)) { JOptionPane.showMessageDialog( null, "The name is already used by other item! ", "Warning", JOptionPane.WARNING_MESSAGE); return; } boolean result = st.updateItem( itemindex, category, name, itemcode, comment, intbuyingprice, intsaleprice, intlength, intwidth, intheight, intvolume, primary, secondary, measurement, producer, third, secondarythirdmeasurement, null); // error editing item data if (!result) { JOptionPane.showMessageDialog( null, "Error editing item data! See log file " + "for detail!", "Warning", JOptionPane.WARNING_MESSAGE); } else { // update the seller item result = sellerdb.insertItemSeller((DefaultListModel) LsSel.getModel(), name); // error editing item data if (!result) { JOptionPane.showMessageDialog( null, "Error inserting item suplier data! See log file " + "for detail!", "Warning", JOptionPane.WARNING_MESSAGE); } } // release the resources dispose(); } // GEN-LAST:event_OKActionPerformed
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; BottomPanel = new javax.swing.JPanel(); Cancel = new javax.swing.JButton(); OK = new javax.swing.JButton(); DummyTopLabel = new javax.swing.JLabel(); LeftDummyLabel = new javax.swing.JLabel(); RightDummyLabel = new javax.swing.JLabel(); ItemTabbedPane = new javax.swing.JTabbedPane(); ItemPanel = new javax.swing.JPanel(); ItemCodeLabel = new javax.swing.JLabel(); itemCodeTF = new javax.swing.JTextField(); nameLabel = new javax.swing.JLabel(); nameTF = new javax.swing.JTextField(); buyingPriceLabel = new javax.swing.JLabel(); buyingPriceTF = new javax.swing.JTextField(); salePriceLabel = new javax.swing.JLabel(); salePriceTF = new javax.swing.JTextField(); commentLabel = new javax.swing.JLabel(); commentTA = new javax.swing.JTextArea(); Notes1 = new javax.swing.JLabel(); Notes2 = new javax.swing.JLabel(); categoryLabel = new javax.swing.JLabel(); categoryTF = new javax.swing.JTextField(); AdditionalPropertiesPanel = new javax.swing.JPanel(); DetailSizeCheckBox = new javax.swing.JCheckBox(); LengthLabel = new javax.swing.JLabel(); LengthTF = new javax.swing.JTextField(); WidthLabel = new javax.swing.JLabel(); WidthTF = new javax.swing.JTextField(); HeightLabel = new javax.swing.JLabel(); HeightTF = new javax.swing.JTextField(); VolumeCheckBox = new javax.swing.JCheckBox(); VolumeLabel = new javax.swing.JLabel(); VolumeTF = new javax.swing.JTextField(); PrimaryMeasurementLabel = new javax.swing.JLabel(); PrimaryTF = new javax.swing.JTextField(); MeasurementLabel = new javax.swing.JLabel(); MeasurementTF = new javax.swing.JTextField(); SecondaryMeasurementLabel = new javax.swing.JLabel(); SecondaryTF = new javax.swing.JTextField(); Notes3 = new javax.swing.JLabel(); Notes4 = new javax.swing.JLabel(); Secondary_Third_Measurement_Label = new javax.swing.JLabel(); Third_Measurement_Label = new javax.swing.JLabel(); SecondaryThirdMeasurementTF = new javax.swing.JTextField(); ThirdTF = new javax.swing.JTextField(); OtherPanel = new javax.swing.JPanel(); ProducerLB = new javax.swing.JLabel(); AvailableSeller = new javax.swing.JScrollPane(); AvSel = new javax.swing.JList(listModel); AddSeller = new javax.swing.JButton(); RemoveSeller = new javax.swing.JButton(); ListSeller = new javax.swing.JScrollPane(); LsSel = new javax.swing.JList(itemsellerModel); AvailableSellers = new javax.swing.JLabel(); ItemSellers = new javax.swing.JLabel(); ProducerCoB = new javax.swing.JComboBox(); QuantityPanel = new javax.swing.JPanel(); QuantityTablePanel = new javax.swing.JPanel(); QuantityScrollPane = new javax.swing.JScrollPane(); QuantityTB = new javax.swing.JTable(); PropertiesPanel = new javax.swing.JPanel(); WarehouseCB = new javax.swing.JComboBox(); QuantityLB = new javax.swing.JLabel(); QuantityButtonPanel = new javax.swing.JPanel(); QuantityAddButton = new javax.swing.JButton(); QuantityEditButton = new javax.swing.JButton(); QuantityDeleteButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Edit Item"); BottomPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 10, 10)); Cancel.setText("Cancel"); Cancel.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CancelActionPerformed(evt); } }); BottomPanel.add(Cancel); OK.setText("OK"); OK.setPreferredSize(new java.awt.Dimension(75, 25)); OK.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { OKActionPerformed(evt); } }); BottomPanel.add(OK); getContentPane().add(BottomPanel, java.awt.BorderLayout.SOUTH); DummyTopLabel.setText(" "); getContentPane().add(DummyTopLabel, java.awt.BorderLayout.NORTH); LeftDummyLabel.setText(" "); getContentPane().add(LeftDummyLabel, java.awt.BorderLayout.WEST); RightDummyLabel.setText(" "); getContentPane().add(RightDummyLabel, java.awt.BorderLayout.EAST); ItemPanel.setLayout(new java.awt.GridBagLayout()); ItemPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1)); ItemCodeLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); ItemCodeLabel.setText("* Item Code : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 10); ItemPanel.add(ItemCodeLabel, gridBagConstraints); itemCodeTF.setColumns(12); itemCodeTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0); ItemPanel.add(itemCodeTF, gridBagConstraints); nameLabel.setText("* Name : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); ItemPanel.add(nameLabel, gridBagConstraints); nameTF.setColumns(12); nameTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); ItemPanel.add(nameTF, gridBagConstraints); buyingPriceLabel.setText("* Buying Price : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 10); ItemPanel.add(buyingPriceLabel, gridBagConstraints); buyingPriceTF.setColumns(12); buyingPriceTF.setFont(new java.awt.Font("Dialog", 1, 12)); buyingPriceTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 0); ItemPanel.add(buyingPriceTF, gridBagConstraints); salePriceLabel.setText("* Sale Price : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 10); ItemPanel.add(salePriceLabel, gridBagConstraints); salePriceTF.setColumns(12); salePriceTF.setFont(new java.awt.Font("Dialog", 1, 12)); salePriceTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(0, 0, 20, 0); ItemPanel.add(salePriceTF, gridBagConstraints); commentLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); commentLabel.setText("Comment : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10); ItemPanel.add(commentLabel, gridBagConstraints); commentTA.setColumns(16); commentTA.setLineWrap(true); commentTA.setRows(6); commentTA.setTabSize(4); commentTA.setWrapStyleWord(true); commentTA.setBorder(javax.swing.BorderFactory.createEtchedBorder()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; ItemPanel.add(commentTA, gridBagConstraints); Notes1.setText("Fields marked with an asterisk * are required."); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 2; ItemPanel.add(Notes1, gridBagConstraints); Notes2.setText( "<html><center>Choose either Detail of Size checkbox <br>\nor Volume checkbox then fill all the text <br>\nfields of that checkbox!</center></html>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.gridwidth = 2; ItemPanel.add(Notes2, gridBagConstraints); categoryLabel.setText("* Category : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); ItemPanel.add(categoryLabel, gridBagConstraints); categoryTF.setColumns(12); categoryTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); ItemPanel.add(categoryTF, gridBagConstraints); ItemTabbedPane.addTab("Item", ItemPanel); AdditionalPropertiesPanel.setLayout(new java.awt.GridBagLayout()); DetailSizeCheckBox.setText("Detail of Size"); DetailSizeCheckBox.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { DetailSizeCheckBoxActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; AdditionalPropertiesPanel.add(DetailSizeCheckBox, gridBagConstraints); LengthLabel.setText("Length : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(LengthLabel, gridBagConstraints); LengthTF.setColumns(12); LengthTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(LengthTF, gridBagConstraints); WidthLabel.setText("Width : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(WidthLabel, gridBagConstraints); WidthTF.setColumns(12); WidthTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(WidthTF, gridBagConstraints); HeightLabel.setText("Height : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(HeightLabel, gridBagConstraints); HeightTF.setColumns(12); HeightTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(HeightTF, gridBagConstraints); VolumeCheckBox.setText("Volume"); VolumeCheckBox.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { VolumeCheckBoxActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; AdditionalPropertiesPanel.add(VolumeCheckBox, gridBagConstraints); VolumeLabel.setText("Volume : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(VolumeLabel, gridBagConstraints); VolumeTF.setColumns(12); VolumeTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 5; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(VolumeTF, gridBagConstraints); PrimaryMeasurementLabel.setText("* Primary Measurement : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(PrimaryMeasurementLabel, gridBagConstraints); PrimaryTF.setColumns(12); PrimaryTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 6; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(PrimaryTF, gridBagConstraints); MeasurementLabel.setText("* P = S : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(MeasurementLabel, gridBagConstraints); MeasurementTF.setColumns(12); MeasurementTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 7; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(MeasurementTF, gridBagConstraints); SecondaryMeasurementLabel.setText("* Secondary Measurement : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 8; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(SecondaryMeasurementLabel, gridBagConstraints); SecondaryTF.setColumns(12); SecondaryTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 8; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(SecondaryTF, gridBagConstraints); Notes3.setText( "<html><center>Choose either Detail of Size checkbox <br>\nor Volume checkbox then fill all the text <br>\nfields of that checkbox!</center></html>"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 12; gridBagConstraints.gridwidth = 2; AdditionalPropertiesPanel.add(Notes3, gridBagConstraints); Notes4.setText("Fields marked with an asterisk * are required."); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 11; gridBagConstraints.gridwidth = 2; AdditionalPropertiesPanel.add(Notes4, gridBagConstraints); Secondary_Third_Measurement_Label.setText("S = T : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 9; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(Secondary_Third_Measurement_Label, gridBagConstraints); Third_Measurement_Label.setText("Third Measurement : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 10; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10); AdditionalPropertiesPanel.add(Third_Measurement_Label, gridBagConstraints); SecondaryThirdMeasurementTF.setColumns(12); SecondaryThirdMeasurementTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 9; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(SecondaryThirdMeasurementTF, gridBagConstraints); ThirdTF.setColumns(12); ThirdTF.setHorizontalAlignment(javax.swing.JTextField.LEFT); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 10; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); AdditionalPropertiesPanel.add(ThirdTF, gridBagConstraints); ItemTabbedPane.addTab("Additional Properties", AdditionalPropertiesPanel); OtherPanel.setLayout(new java.awt.GridBagLayout()); ProducerLB.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); ProducerLB.setText("Producer : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; OtherPanel.add(ProducerLB, gridBagConstraints); AvailableSeller.setBorder(javax.swing.BorderFactory.createEtchedBorder()); AvailableSeller.setPreferredSize(new java.awt.Dimension(200, 100)); AvSel.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); AvSel.setVisibleRowCount(-1); AvailableSeller.setViewportView(AvSel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(10, 20, 0, 20); OtherPanel.add(AvailableSeller, gridBagConstraints); AddSeller.setText(">"); AddSeller.setName("toRight"); AddSeller.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MoveSellerActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0); OtherPanel.add(AddSeller, gridBagConstraints); RemoveSeller.setText("<"); RemoveSeller.setName("toLeft"); RemoveSeller.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { MoveSellerActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; OtherPanel.add(RemoveSeller, gridBagConstraints); ListSeller.setBorder(javax.swing.BorderFactory.createEtchedBorder()); ListSeller.setPreferredSize(new java.awt.Dimension(200, 100)); LsSel.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); LsSel.setVisibleRowCount(-1); ListSeller.setViewportView(LsSel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.gridheight = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.insets = new java.awt.Insets(10, 20, 0, 20); OtherPanel.add(ListSeller, gridBagConstraints); AvailableSellers.setText("Available Sellers : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0); OtherPanel.add(AvailableSellers, gridBagConstraints); ItemSellers.setText("Item Sellers : "); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0); OtherPanel.add(ItemSellers, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; OtherPanel.add(ProducerCoB, gridBagConstraints); ItemTabbedPane.addTab("Producer & Seller", OtherPanel); QuantityTablePanel.setLayout(new java.awt.BorderLayout()); QuantityTB.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { {null, null}, {null, null}, {null, null}, {null, null} }, new String[] {"Date", "Quantity"}) { Class[] types = new Class[] {java.lang.String.class, java.lang.Integer.class}; boolean[] canEdit = new boolean[] {false, false}; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); QuantityScrollPane.setViewportView(QuantityTB); QuantityTablePanel.add(QuantityScrollPane, java.awt.BorderLayout.CENTER); WarehouseCB.setModel( new javax.swing.DefaultComboBoxModel( new String[] {"Item 1", "Item 2", "Item 3", "Item 4"})); WarehouseCB.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { WarehouseCBActionPerformed(evt); } }); PropertiesPanel.add(WarehouseCB); QuantityLB.setText("jLabel1"); PropertiesPanel.add(QuantityLB); QuantityTablePanel.add(PropertiesPanel, java.awt.BorderLayout.NORTH); QuantityAddButton.setText("Add"); QuantityAddButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { QuantityAddButtonActionPerformed(evt); } }); QuantityButtonPanel.add(QuantityAddButton); QuantityEditButton.setText("Edit"); QuantityEditButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { QuantityEditButtonActionPerformed(evt); } }); QuantityButtonPanel.add(QuantityEditButton); QuantityDeleteButton.setText("Delete"); QuantityDeleteButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { QuantityDeleteButtonActionPerformed(evt); } }); QuantityButtonPanel.add(QuantityDeleteButton); QuantityTablePanel.add(QuantityButtonPanel, java.awt.BorderLayout.SOUTH); QuantityPanel.add(QuantityTablePanel); ItemTabbedPane.addTab("Quantity", QuantityPanel); getContentPane().add(ItemTabbedPane, java.awt.BorderLayout.CENTER); pack(); } // </editor-fold>//GEN-END:initComponents