コード例 #1
0
  /**
   * 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() { // GEN-BEGIN:initComponents
    java.awt.GridBagConstraints gridBagConstraints;

    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    TopPanel = new javax.swing.JPanel();
    TopRightPanel = new javax.swing.JPanel();
    OtherDateChooser = new com.toedter.calendar.JDateChooser();
    TopLeftPanel = new javax.swing.JPanel();
    InvoiceLB = new javax.swing.JLabel();
    InvoiceTF = new javax.swing.JTextField();
    BottomPanel = new javax.swing.JPanel();
    Cancel = new javax.swing.JButton();
    OK = new javax.swing.JButton();
    DummyLeftLabel = new javax.swing.JLabel();
    RightDummyLabel = new javax.swing.JLabel();
    TaxPanel = new javax.swing.JPanel();
    AmountLabel = new javax.swing.JLabel();
    AmountTF = new javax.swing.JTextField();
    DescriptionLabel = new javax.swing.JLabel();
    DescriptionArea = new javax.swing.JTextArea();
    IncomeTransactionLabel = new javax.swing.JLabel();

    jMenu1.setText("Menu");
    jMenuBar1.add(jMenu1);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Income Dialog");
    TopPanel.setLayout(new java.awt.BorderLayout());

    TopRightPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 10, 10));

    OtherDateChooser.setPreferredSize(new java.awt.Dimension(151, 20));
    TopRightPanel.add(OtherDateChooser);

    TopPanel.add(TopRightPanel, java.awt.BorderLayout.EAST);

    TopLeftPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 10, 10));

    InvoiceLB.setText("Invoice : ");
    TopLeftPanel.add(InvoiceLB);

    InvoiceTF.setColumns(12);
    TopLeftPanel.add(InvoiceTF);

    TopPanel.add(TopLeftPanel, java.awt.BorderLayout.WEST);

    getContentPane().add(TopPanel, java.awt.BorderLayout.NORTH);

    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);

    DummyLeftLabel.setText("     ");
    getContentPane().add(DummyLeftLabel, java.awt.BorderLayout.WEST);

    RightDummyLabel.setText("     ");
    getContentPane().add(RightDummyLabel, java.awt.BorderLayout.EAST);

    TaxPanel.setLayout(new java.awt.GridBagLayout());

    AmountLabel.setText("Amount of Transactions :");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10);
    TaxPanel.add(AmountLabel, gridBagConstraints);

    AmountTF.setColumns(24);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0);
    TaxPanel.add(AmountTF, gridBagConstraints);

    DescriptionLabel.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    DescriptionLabel.setText("Description :");
    DescriptionLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10);
    TaxPanel.add(DescriptionLabel, gridBagConstraints);

    DescriptionArea.setColumns(24);
    DescriptionArea.setLineWrap(true);
    DescriptionArea.setRows(5);
    DescriptionArea.setWrapStyleWord(true);
    DescriptionArea.setBorder(new javax.swing.border.EtchedBorder());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridheight = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    TaxPanel.add(DescriptionArea, gridBagConstraints);

    IncomeTransactionLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    IncomeTransactionLabel.setText("Income Transaction");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 10);
    TaxPanel.add(IncomeTransactionLabel, gridBagConstraints);

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

    pack();
  } // GEN-END:initComponents
コード例 #2
0
  /**
   * 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.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    NewFileTypeTextBox = new javax.swing.JTextField();
    AddType = new javax.swing.JButton();
    Cancel = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    FileTypeAbbreviationTextBox = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Add New File Type");
    setResizable(false);

    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("New File Type");

    jLabel2.setText("File Name:");

    AddType.setText("Add New Type");
    AddType.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            AddTypeActionPerformed(evt);
          }
        });

    Cancel.setText("Cancel");
    Cancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            CancelActionPerformed(evt);
          }
        });

    jLabel3.setText("Abbreviation:");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(
                                                jLabel2,
                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                jLabel3,
                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                NewFileTypeTextBox,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                250,
                                                Short.MAX_VALUE)
                                            .addComponent(FileTypeAbbreviationTextBox))
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(
                                AddType,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                Cancel,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                NewFileTypeTextBox,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(
                                FileTypeAbbreviationTextBox,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                    .addComponent(AddType)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(Cancel)
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #3
0
  // <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
コード例 #4
0
  /**
   * 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.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    Cancel = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    AddTypeButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Activity Type Maintenance Panel");
    setResizable(false);

    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Activity Type Maintenance");

    Cancel.setText("Cancel");
    Cancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            CancelActionPerformed(evt);
          }
        });

    jTable1.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {}, new String[] {"", "Activity", "Active"}) {

          Class[] types =
              new Class[] {java.lang.String.class, java.lang.String.class, java.lang.String.class};
          boolean[] canEdit = new boolean[] {false, false, true};

          public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
          }

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    jTable1.setColumnSelectionAllowed(true);
    jTable1.getTableHeader().setReorderingAllowed(false);
    jScrollPane1.setViewportView(jTable1);
    jTable1
        .getColumnModel()
        .getSelectionModel()
        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    if (jTable1.getColumnModel().getColumnCount() > 0) {
      jTable1.getColumnModel().getColumn(0).setResizable(false);
      jTable1.getColumnModel().getColumn(1).setResizable(false);
      jTable1.getColumnModel().getColumn(2).setResizable(false);
    }

    AddTypeButton.setText("Add Type");
    AddTypeButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            AddTypeButtonActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 303, Short.MAX_VALUE)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                303,
                                Short.MAX_VALUE)
                            .addComponent(
                                AddTypeButton,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                Cancel,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jLabel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        19,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        268,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
                    .addComponent(AddTypeButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(Cancel)
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents