コード例 #1
0
ファイル: PlayBarView.java プロジェクト: stephysim/BitMusic
  @Override
  public void initPanel() {
    System.out.println("--- PlayBarView.initPanel()");

    final Dimension d = new Dimension(40, 10);

    this.playButton.setSize(d);
    this.stopButton.setSize(d);
    this.downloadButton.setSize(d);

    /*GridLayout layout = new GridLayout(0,2);
    this.getPanel().setLayout(layout);
    this.getPanel().add(this.stopButton);
    this.getPanel().add(this.playButton);
    this.getPanel().add(this.downloadButton);*/
    GroupLayout layout = new GroupLayout(this.getPanel());
    this.getPanel().setLayout(layout);

    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);

    layout.setHorizontalGroup(
        layout
            .createSequentialGroup()
            .addComponent(this.stopButton)
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(this.playButton))
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(this.downloadButton)));

    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(this.stopButton)
                    .addComponent(this.playButton)
                    .addComponent(this.downloadButton)));

    layout.linkSize(SwingConstants.HORIZONTAL, this.playButton, this.stopButton);
    layout.linkSize(SwingConstants.HORIZONTAL, this.playButton, this.downloadButton);

    // TODO
  }
コード例 #2
0
  // constructor for form
  private void initComponents() {
    // elements for error message
    errorMessage = new JLabel();
    errorMessage.setForeground(Color.RED);

    // elements for participant
    participantNameTextField = new JTextField();
    participantNameLabel = new JLabel();
    addParticipantButton = new JButton();

    // global settings & listeners
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setTitle("Event Registration");

    participantNameLabel.setText("Name: ");
    addParticipantButton.setText("Add Participant");
    addParticipantButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addParticipantButtonActionPerformed(evt);
          }
        });

    // layout
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);

    layout.setHorizontalGroup(
        layout
            .createParallelGroup()
            .addComponent(errorMessage)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(participantNameLabel)
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(participantNameTextField, 200, 200, 400)
                            .addComponent(addParticipantButton))));

    layout.linkSize(
        SwingConstants.HORIZONTAL,
        new java.awt.Component[] {addParticipantButton, participantNameTextField});

    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addComponent(errorMessage)
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(participantNameLabel)
                    .addComponent(participantNameTextField))
            .addComponent(addParticipantButton));

    pack();
  }
コード例 #3
0
  private void createLayout(JComponent... comps) {
    Container pane = getContentPane();
    GroupLayout gl = new GroupLayout(pane);
    pane.setLayout(gl);

    gl.setAutoCreateContainerGaps(true);
    gl.setAutoCreateGaps(true);

    gl.setHorizontalGroup(
        gl.createSequentialGroup()
            .addGroup(
                gl.createParallelGroup()
                    .addComponent(comps[0])
                    .addComponent(comps[1])
                    .addComponent(comps[2]))
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(comps[3]));

    gl.setVerticalGroup(
        gl.createParallelGroup(GroupLayout.Alignment.CENTER)
            .addGroup(
                gl.createSequentialGroup()
                    .addComponent(comps[0])
                    .addComponent(comps[1])
                    .addComponent(comps[2]))
            .addComponent(comps[3]));

    // Forces the specified components to have the same size regardless of
    // their preferred, minimum or maximum sizes.
    gl.linkSize(redButton, greenButton, blueButton);

    pack();
  }
コード例 #4
0
ファイル: LoginBox.java プロジェクト: WDCore/awstest
  public void createLayout() {
    GroupLayout layout = new GroupLayout(this.getContentPane());
    this.getContentPane().setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);

    layout.setHorizontalGroup(
        layout
            .createParallelGroup()
            .addComponent(lbUsername)
            .addComponent(tfUsername)
            .addComponent(lbPassword)
            .addComponent(tfPassword)
            .addComponent(btLogin));

    layout.linkSize(tfUsername, tfPassword);

    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addComponent(lbUsername)
            .addComponent(tfUsername)
            .addComponent(lbPassword)
            .addComponent(tfPassword)
            .addGap(20)
            .addComponent(btLogin));
  }
コード例 #5
0
  private void initUI() {

    JPanel jPanel = new JPanel();
    GroupLayout layout = new GroupLayout(jPanel);
    jPanel.setLayout(layout);

    statusBar = new JLabel("Zetcode");
    statusBar.setBorder(BorderFactory.createEtchedBorder());

    ButtonListener butlist = new ButtonListener();

    JButton closeButton = new JButton("Close");
    closeButton.addActionListener(butlist);
    closeButton.setPreferredSize(new Dimension(100, 50));

    JButton openButton = new JButton("Open");
    openButton.addActionListener(butlist);

    JButton findButton = new JButton("Find");
    findButton.addActionListener(butlist);

    JButton saveButton = new JButton("Save");
    saveButton.addActionListener(butlist);

    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(true);

    layout.setHorizontalGroup(
        layout
            .createSequentialGroup()
            .addComponent(closeButton)
            .addComponent(openButton)
            .addComponent(findButton)
            .addComponent(saveButton)
            .addGap(230));

    layout.setVerticalGroup(
        layout
            .createParallelGroup()
            .addComponent(closeButton)
            .addComponent(openButton)
            .addComponent(findButton)
            .addComponent(saveButton)
            .addGap(200));

    layout.linkSize(closeButton, openButton, findButton, saveButton);

    add(jPanel, BorderLayout.CENTER);
    add(statusBar, BorderLayout.SOUTH);
    pack();

    setSize(new Dimension(1000, 1000));
    setTitle("Multiple Sources");
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  }
コード例 #6
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() {

    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Nouveau groupe de paramètres");

    jPanel1.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            null,
            "Groupe de paramètres",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION,
            new java.awt.Font("DejaVu Sans", 1, 14))); // NOI18N

    jLabel1.setText("id");

    jLabel2.setForeground(new java.awt.Color(255, 0, 0));
    jLabel2.setText("*");

    jLabel3.setText("nom");

    jLabel4.setForeground(new java.awt.Color(255, 0, 0));
    jLabel4.setText("*");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jTextField1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        95,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel4)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jTextField2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        95,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(29, 29, 29)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(
                                jTextField1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(
                                jTextField2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(21, Short.MAX_VALUE)));

    jButton1.setText("Paramètres");

    jButton2.setText("Enregistrer");

    jButton3.setText("Annuler");

    jLabel5.setForeground(new java.awt.Color(255, 0, 0));
    jLabel5.setText("*");

    jLabel6.setText("champs obligatoires");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(126, 126, 126)
                    .addComponent(
                        jButton1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        113,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel5)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        jLabel6,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        120,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        72,
                                        Short.MAX_VALUE)
                                    .addComponent(jButton3)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton2)))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButton2, jButton3});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jButton1)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton2)
                            .addComponent(jButton3)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButton2, jButton3});

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #7
0
ファイル: GUI.java プロジェクト: Jackson3195/PipesRUs
  /**
   * 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() {

    basePanel = new javax.swing.JPanel();
    inputPanel = new javax.swing.JPanel();
    pLength = new javax.swing.JLabel();
    lengthTF = new javax.swing.JTextField();
    pDiameter = new javax.swing.JLabel();
    diameterTF = new javax.swing.JTextField();
    pGrade = new javax.swing.JLabel();
    gradeCB = new javax.swing.JComboBox();
    pColour = new javax.swing.JLabel();
    colourCB = new javax.swing.JComboBox();
    xtraPanel = new javax.swing.JPanel();
    insulCheck = new javax.swing.JCheckBox();
    reinforceCheck = new javax.swing.JCheckBox();
    chemCheck = new javax.swing.JCheckBox();
    clearButton = new javax.swing.JButton();
    calcButton = new javax.swing.JButton();
    infoPanel = new javax.swing.JPanel();
    jScrollPanel1 = new javax.swing.JScrollPane();
    pipesInfoOutput = new javax.swing.JTextArea();
    pQuantity = new javax.swing.JLabel();
    quantityTF = new javax.swing.JTextField();
    addToBasket = new javax.swing.JButton();
    basketPanel = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    basketTable = new javax.swing.JTable();
    checkoutButton = new javax.swing.JButton();
    totalTF = new javax.swing.JTextField();
    pTotal = new javax.swing.JLabel();
    emptyButton = new javax.swing.JButton();
    tableInfo = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Pipes'R'US");

    basePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Pipes'R'Us"));

    inputPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Specification"));

    pLength.setText("Length:");

    lengthTF.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    lengthTF.setText("meters");
    lengthTF.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusGained(java.awt.event.FocusEvent evt) {
            lengthFocus(evt);
          }
        });

    pDiameter.setText("Diameter:");

    diameterTF.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    diameterTF.setText("inches");
    diameterTF.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusGained(java.awt.event.FocusEvent evt) {
            diameterFocus(evt);
          }
        });

    pGrade.setText("Plastic Grade:");

    gradeCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"1", "2", "3", "4", "5"}));

    pColour.setText("Colour Print:");

    colourCB.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"None", "1", "2"}));

    xtraPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Optional Extra's"));

    insulCheck.setText("Inner Insulation");

    reinforceCheck.setText("Outer Reinforcement");

    chemCheck.setText("Chemical Resistence");

    javax.swing.GroupLayout xtraPanelLayout = new javax.swing.GroupLayout(xtraPanel);
    xtraPanel.setLayout(xtraPanelLayout);
    xtraPanelLayout.setHorizontalGroup(
        xtraPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                xtraPanelLayout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        xtraPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(reinforceCheck)
                            .addComponent(
                                insulCheck,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                127,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(chemCheck))
                    .addContainerGap()));

    xtraPanelLayout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {chemCheck, insulCheck, reinforceCheck});

    xtraPanelLayout.setVerticalGroup(
        xtraPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                xtraPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(insulCheck)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(reinforceCheck)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        chemCheck,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        23,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    xtraPanelLayout.linkSize(
        javax.swing.SwingConstants.VERTICAL,
        new java.awt.Component[] {chemCheck, insulCheck, reinforceCheck});

    clearButton.setText("Clear");
    clearButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearButtonActionPerformed(evt);
          }
        });

    calcButton.setText("Calculate");
    calcButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            calcButtonActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout inputPanelLayout = new javax.swing.GroupLayout(inputPanel);
    inputPanel.setLayout(inputPanelLayout);
    inputPanelLayout.setHorizontalGroup(
        inputPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                inputPanelLayout
                    .createSequentialGroup()
                    .addGroup(
                        inputPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.LEADING,
                                inputPanelLayout
                                    .createSequentialGroup()
                                    .addGap(208, 208, 208)
                                    .addComponent(
                                        clearButton,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        calcButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        106,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.LEADING,
                                inputPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(pColour)
                                            .addComponent(pLength)
                                            .addComponent(pDiameter)
                                            .addComponent(pGrade))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                inputPanelLayout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(
                                                        gradeCB,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        91,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(
                                                        colourCB,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        93,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                inputPanelLayout
                                                    .createSequentialGroup()
                                                    .addGap(2, 2, 2)
                                                    .addGroup(
                                                        inputPanelLayout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .TRAILING,
                                                                false)
                                                            .addComponent(
                                                                lengthTF,
                                                                javax.swing.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                91,
                                                                Short.MAX_VALUE)
                                                            .addComponent(diameterTF))))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        xtraPanel,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)))
                    .addGap(2, 2, 2)));
    inputPanelLayout.setVerticalGroup(
        inputPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                inputPanelLayout
                    .createSequentialGroup()
                    .addGroup(
                        inputPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(
                                inputPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                lengthTF,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(pLength))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                diameterTF,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(pDiameter))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                gradeCB,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(pGrade))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        inputPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(pColour)
                                            .addComponent(
                                                colourCB,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(
                                xtraPanel,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        inputPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(clearButton)
                            .addComponent(calcButton))
                    .addContainerGap()));

    infoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Information\n"));

    pipesInfoOutput.setColumns(20);
    pipesInfoOutput.setRows(5);
    pipesInfoOutput.setFocusable(false);
    jScrollPanel1.setViewportView(pipesInfoOutput);
    pipesInfoOutput.getAccessibleContext().setAccessibleName("");

    pQuantity.setText("Quantity:");

    quantityTF.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    quantityTF.setText("1");

    addToBasket.setText("Add to Basket");
    addToBasket.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addToBasketActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout infoPanelLayout = new javax.swing.GroupLayout(infoPanel);
    infoPanel.setLayout(infoPanelLayout);
    infoPanelLayout.setHorizontalGroup(
        infoPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                infoPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        infoPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPanel1)
                            .addGroup(
                                infoPanelLayout
                                    .createSequentialGroup()
                                    .addComponent(pQuantity)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        quantityTF,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        70,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(addToBasket)))
                    .addContainerGap()));
    infoPanelLayout.setVerticalGroup(
        infoPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                infoPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jScrollPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        152,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        infoPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                quantityTF,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(pQuantity)
                            .addComponent(addToBasket))));

    jScrollPanel1.getAccessibleContext().setAccessibleName("");

    basketPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Basket"));

    basketTable.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {}, new String[] {"Type", "Length", "Width", "Grade", "Colour"}) {

          boolean[] canEdit = new boolean[] {false, false, false, false, false};

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    basketTable.setFocusable(false);
    basketTable.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mousePressed(java.awt.event.MouseEvent evt) {
            basketTableMousePressed(evt);
          }
        });
    jScrollPane2.setViewportView(basketTable);

    checkoutButton.setText("Checkout");
    checkoutButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkoutButtonActionPerformed(evt);
          }
        });

    totalTF.setFocusable(false);

    pTotal.setText("Total:");

    emptyButton.setText("Empty Basket");
    emptyButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            emptyButtonActionPerformed(evt);
          }
        });

    tableInfo.setText("• Single click to view individual pipe information.");

    jLabel1.setText("• Double click to delete indivudual pipe order.");

    javax.swing.GroupLayout basketPanelLayout = new javax.swing.GroupLayout(basketPanel);
    basketPanel.setLayout(basketPanelLayout);
    basketPanelLayout.setHorizontalGroup(
        basketPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                basketPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        basketPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jScrollPane2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                0,
                                Short.MAX_VALUE)
                            .addGroup(
                                basketPanelLayout
                                    .createSequentialGroup()
                                    .addComponent(pTotal)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        totalTF,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        95,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(emptyButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(checkoutButton))
                            .addGroup(
                                basketPanelLayout
                                    .createSequentialGroup()
                                    .addGroup(
                                        basketPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(tableInfo)
                                            .addComponent(jLabel1))
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    basketPanelLayout.setVerticalGroup(
        basketPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                basketPanelLayout
                    .createSequentialGroup()
                    .addComponent(tableInfo)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jLabel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        16,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        basketPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(pTotal)
                            .addComponent(
                                totalTF,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(checkoutButton)
                            .addComponent(emptyButton))
                    .addContainerGap()));

    javax.swing.GroupLayout basePanelLayout = new javax.swing.GroupLayout(basePanel);
    basePanel.setLayout(basePanelLayout);
    basePanelLayout.setHorizontalGroup(
        basePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                basePanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        basePanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                inputPanel,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                infoPanel,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        basketPanel,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addContainerGap()));
    basePanelLayout.setVerticalGroup(
        basePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                basePanelLayout
                    .createSequentialGroup()
                    .addGroup(
                        basePanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(
                                basketPanel,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                basePanelLayout
                                    .createSequentialGroup()
                                    .addComponent(
                                        inputPanel,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        infoPanel,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(15, Short.MAX_VALUE)));

    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()
                    .addComponent(
                        basePanel,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        basePanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    setSize(new java.awt.Dimension(869, 619));
    setLocationRelativeTo(null);
  } // </editor-fold>//GEN-END:initComponents
コード例 #8
0
ファイル: FingerprintView.java プロジェクト: niels581/etf-mms
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    mainPanel = new javax.swing.JPanel();
    masterScrollPane = new javax.swing.JScrollPane();
    masterTable = new javax.swing.JTable();
    idLabel = new javax.swing.JLabel();
    imeLabel = new javax.swing.JLabel();
    prezimeLabel = new javax.swing.JLabel();
    adresaLabel = new javax.swing.JLabel();
    brojlicneLabel = new javax.swing.JLabel();
    sifraotiskaLabel = new javax.swing.JLabel();
    idField = new javax.swing.JTextField();
    imeField = new javax.swing.JTextField();
    prezimeField = new javax.swing.JTextField();
    adresaField = new javax.swing.JTextField();
    brojlicneField = new javax.swing.JTextField();
    sifraotiskaField = new javax.swing.JTextField();
    saveButton = new javax.swing.JButton();
    refreshButton = new javax.swing.JButton();
    newButton = new javax.swing.JButton();
    deleteButton = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    javax.swing.JMenu fileMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem newRecordMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenuItem deleteRecordMenuItem = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JSeparator();
    javax.swing.JMenuItem saveMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenuItem refreshMenuItem = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JSeparator();
    javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
    statusPanel = new javax.swing.JPanel();
    javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
    statusMessageLabel = new javax.swing.JLabel();
    statusAnimationLabel = new javax.swing.JLabel();
    progressBar = new javax.swing.JProgressBar();
    org.jdesktop.application.ResourceMap resourceMap =
        org.jdesktop.application.Application.getInstance(
                fingerprintapplication.FingerprintApplication.class)
            .getContext()
            .getResourceMap(FingerprintView.class);
    entityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory(
                    resourceMap.getString("entityManager.persistenceUnit"))
                .createEntityManager(); // NOI18N
    query =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N
    list =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                query.getResultList());

    mainPanel.setName("mainPanel"); // NOI18N

    masterScrollPane.setName("masterScrollPane"); // NOI18N

    masterTable.setName("masterTable"); // NOI18N

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${ime}"));
    columnBinding.setColumnName("Ime");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${prezime}"));
    columnBinding.setColumnName("Prezime");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${adresa}"));
    columnBinding.setColumnName("Adresa");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${brojlicne}"));
    columnBinding.setColumnName("Brojlicne");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${sifraotiska}"));
    columnBinding.setColumnName("Sifraotiska");
    columnBinding.setColumnClass(String.class);
    bindingGroup.addBinding(jTableBinding);

    masterScrollPane.setViewportView(masterTable);

    idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
    idLabel.setName("idLabel"); // NOI18N

    imeLabel.setText(resourceMap.getString("imeLabel.text")); // NOI18N
    imeLabel.setName("imeLabel"); // NOI18N

    prezimeLabel.setText(resourceMap.getString("prezimeLabel.text")); // NOI18N
    prezimeLabel.setName("prezimeLabel"); // NOI18N

    adresaLabel.setText(resourceMap.getString("adresaLabel.text")); // NOI18N
    adresaLabel.setName("adresaLabel"); // NOI18N

    brojlicneLabel.setText(resourceMap.getString("brojlicneLabel.text")); // NOI18N
    brojlicneLabel.setName("brojlicneLabel"); // NOI18N

    sifraotiskaLabel.setText(resourceMap.getString("sifraotiskaLabel.text")); // NOI18N
    sifraotiskaLabel.setName("sifraotiskaLabel"); // NOI18N

    idField.setName("idField"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"),
            idField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            idField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    imeField.setName("imeField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.ime}"),
            imeField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            imeField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    prezimeField.setName("prezimeField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.prezime}"),
            prezimeField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            prezimeField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    adresaField.setName("adresaField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.adresa}"),
            adresaField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            adresaField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    brojlicneField.setName("brojlicneField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.brojlicne}"),
            brojlicneField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            brojlicneField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    sifraotiskaField.setName("sifraotiskaField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.sifraotiska}"),
            sifraotiskaField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            sifraotiskaField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance(
                fingerprintapplication.FingerprintApplication.class)
            .getContext()
            .getActionMap(FingerprintView.class, this);
    saveButton.setAction(actionMap.get("save")); // NOI18N
    saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N
    saveButton.setName("saveButton"); // NOI18N

    refreshButton.setAction(actionMap.get("refresh")); // NOI18N
    refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N
    refreshButton.setName("refreshButton"); // NOI18N

    newButton.setAction(actionMap.get("newRecord")); // NOI18N
    newButton.setText(resourceMap.getString("newButton.text")); // NOI18N
    newButton.setName("newButton"); // NOI18N

    deleteButton.setAction(actionMap.get("deleteRecord")); // NOI18N
    deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N
    deleteButton.setName("deleteButton"); // NOI18N

    javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(
        mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                mainPanelLayout
                    .createSequentialGroup()
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addComponent(newButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(deleteButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(refreshButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(saveButton))
                            .addGroup(
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        mainPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(idLabel)
                                            .addComponent(imeLabel)
                                            .addComponent(prezimeLabel)
                                            .addComponent(adresaLabel)
                                            .addComponent(brojlicneLabel)
                                            .addComponent(sifraotiskaLabel))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        mainPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                idField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                imeField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                prezimeField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                adresaField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                brojlicneField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                sifraotiskaField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)))
                            .addGroup(
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        masterScrollPane,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        427,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));

    mainPanelLayout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton});

    mainPanelLayout.setVerticalGroup(
        mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                mainPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        masterScrollPane,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        189,
                        Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(idLabel)
                            .addComponent(
                                idField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(imeLabel)
                            .addComponent(
                                imeField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(prezimeLabel)
                            .addComponent(
                                prezimeField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(adresaLabel)
                            .addComponent(
                                adresaField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(brojlicneLabel)
                            .addComponent(
                                brojlicneField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(sifraotiskaLabel)
                            .addComponent(
                                sifraotiskaField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(saveButton)
                            .addComponent(refreshButton)
                            .addComponent(deleteButton)
                            .addComponent(newButton))
                    .addContainerGap()));

    menuBar.setName("menuBar"); // NOI18N

    fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
    fileMenu.setName("fileMenu"); // NOI18N

    newRecordMenuItem.setAction(actionMap.get("newRecord")); // NOI18N
    newRecordMenuItem.setText(resourceMap.getString("newRecordMenuItem.text")); // NOI18N
    newRecordMenuItem.setName("newRecordMenuItem"); // NOI18N
    fileMenu.add(newRecordMenuItem);

    deleteRecordMenuItem.setAction(actionMap.get("deleteRecord")); // NOI18N
    deleteRecordMenuItem.setText(resourceMap.getString("deleteRecordMenuItem.text")); // NOI18N
    deleteRecordMenuItem.setName("deleteRecordMenuItem"); // NOI18N
    fileMenu.add(deleteRecordMenuItem);

    jSeparator1.setName("jSeparator1"); // NOI18N
    fileMenu.add(jSeparator1);

    saveMenuItem.setAction(actionMap.get("save")); // NOI18N
    saveMenuItem.setText(resourceMap.getString("saveMenuItem.text")); // NOI18N
    saveMenuItem.setName("saveMenuItem"); // NOI18N
    fileMenu.add(saveMenuItem);

    refreshMenuItem.setAction(actionMap.get("refresh")); // NOI18N
    refreshMenuItem.setText(resourceMap.getString("refreshMenuItem.text")); // NOI18N
    refreshMenuItem.setName("refreshMenuItem"); // NOI18N
    fileMenu.add(refreshMenuItem);

    jSeparator2.setName("jSeparator2"); // NOI18N
    fileMenu.add(jSeparator2);

    exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
    exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
    exitMenuItem.setName("exitMenuItem"); // NOI18N
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    statusPanel.setName("statusPanel"); // NOI18N

    statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

    statusMessageLabel.setName("statusMessageLabel"); // NOI18N

    statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

    progressBar.setName("progressBar"); // NOI18N

    javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
    statusPanel.setLayout(statusPanelLayout);
    statusPanelLayout.setHorizontalGroup(
        statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
            .addGroup(
                statusPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(statusMessageLabel)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 277, Short.MAX_VALUE)
                    .addComponent(
                        progressBar,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusAnimationLabel)
                    .addContainerGap()));
    statusPanelLayout.setVerticalGroup(
        statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                statusPanelLayout
                    .createSequentialGroup()
                    .addComponent(
                        statusPanelSeparator,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        2,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        statusPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(statusMessageLabel)
                            .addComponent(statusAnimationLabel)
                            .addComponent(
                                progressBar,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3)));

    setComponent(mainPanel);
    setMenuBar(menuBar);
    setStatusBar(statusPanel);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
コード例 #9
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() {

    findJLabel = new javax.swing.JLabel();
    inputTxt = new javax.swing.JTextField();
    previousButton = new javax.swing.JButton();
    nextButton = new javax.swing.JButton();
    indexLabel = new javax.swing.JLabel();

    setOpaque(false);

    findJLabel.setText("Find");

    inputTxt.setForeground(new java.awt.Color(204, 204, 204));
    inputTxt.setHorizontalAlignment(javax.swing.JTextField.CENTER);
    inputTxt.setText("(peptide or protein)");
    inputTxt.setBorder(
        javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
    inputTxt.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseReleased(java.awt.event.MouseEvent evt) {
            inputTxtMouseReleased(evt);
          }
        });
    inputTxt.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyReleased(java.awt.event.KeyEvent evt) {
            inputTxtKeyReleased(evt);
          }
        });

    previousButton.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/icons/previous_grey.png"))); // NOI18N
    previousButton.setToolTipText("Previous");
    previousButton.setBorder(null);
    previousButton.setBorderPainted(false);
    previousButton.setContentAreaFilled(false);
    previousButton.setIconTextGap(0);
    previousButton.setRolloverIcon(
        new javax.swing.ImageIcon(getClass().getResource("/icons/previous.png"))); // NOI18N
    previousButton.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseEntered(java.awt.event.MouseEvent evt) {
            previousButtonMouseEntered(evt);
          }

          public void mouseExited(java.awt.event.MouseEvent evt) {
            previousButtonMouseExited(evt);
          }
        });
    previousButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            previousButtonActionPerformed(evt);
          }
        });

    nextButton.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/icons/next_grey.png"))); // NOI18N
    nextButton.setToolTipText("Next");
    nextButton.setBorderPainted(false);
    nextButton.setContentAreaFilled(false);
    nextButton.setRolloverIcon(
        new javax.swing.ImageIcon(getClass().getResource("/icons/next.png"))); // NOI18N
    nextButton.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseEntered(java.awt.event.MouseEvent evt) {
            nextButtonMouseEntered(evt);
          }

          public void mouseExited(java.awt.event.MouseEvent evt) {
            nextButtonMouseExited(evt);
          }
        });
    nextButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextButtonActionPerformed(evt);
          }
        });

    indexLabel.setFont(
        indexLabel.getFont().deriveFont((indexLabel.getFont().getStyle() | java.awt.Font.ITALIC)));
    indexLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    indexLabel.setText(" ");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(findJLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        inputTxt,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        205,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        previousButton,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        15,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, 0)
                    .addComponent(
                        nextButton,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        15,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        indexLabel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        97,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {nextButton, previousButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(findJLabel)
                            .addComponent(
                                inputTxt,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(indexLabel)
                            .addComponent(
                                previousButton,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                15,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                nextButton,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                15,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
  } // </editor-fold>//GEN-END:initComponents
コード例 #10
0
  /** This method is called from within the constructor to initialize the form. */
  @SuppressWarnings("unchecked")
  private void initComponents() {

    // elements of user interface
    selectCourseLabel = new JLabel();
    selectCourse = new JComboBox<Course>();
    jPanel10 = new JPanel();
    courseCodeLabel = new JLabel();
    courseTitleLabel = new JLabel();
    courseTermLabel = new JLabel();
    courseCode = new JLabel();
    courseTitle = new JLabel();
    courseTerm = new JLabel();
    deleteCourseButton = new JButton();
    alert = new JLabel();

    selectCourseLabel.setText("Select Course:");

    selectCourse.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectCourseActionPerformed(evt);
          }
        });

    // Add list of courses to combo box
    for (int i = 0; i < courses.size(); i++) selectCourse.addItem(courses.get(i));

    jPanel10.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    courseCodeLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    courseCodeLabel.setText("Course Code:");

    courseTitleLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    courseTitleLabel.setText("Course Title:");

    courseTermLabel.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    courseTermLabel.setText("Course Term:");

    courseCode.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N

    courseTitle.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N

    courseTerm.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N

    deleteCourseButton.setText("Delete");
    deleteCourseButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteCourseButtonActionPerformed(evt);
          }
        });

    alert.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N

    // user interface layout
    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
        jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel10Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(courseCodeLabel)
                            .addComponent(courseTitleLabel)
                            .addComponent(courseTermLabel))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel10Layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        alert,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGap(18, 18, 18)
                                    .addComponent(deleteCourseButton))
                            .addComponent(
                                courseCode,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                341,
                                Short.MAX_VALUE)
                            .addComponent(
                                courseTitle,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                courseTerm,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel10Layout.setVerticalGroup(
        jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel10Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(courseCodeLabel)
                            .addComponent(courseCode))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(courseTitleLabel)
                            .addComponent(courseTitle))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(courseTermLabel)
                            .addComponent(courseTerm))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel10Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                deleteCourseButton,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                alert,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap(127, Short.MAX_VALUE)));

    jPanel10Layout.linkSize(
        javax.swing.SwingConstants.VERTICAL,
        new java.awt.Component[] {
          courseCode, courseCodeLabel, courseTerm, courseTermLabel, courseTitle, courseTitleLabel
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jPanel10,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(selectCourseLabel)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        selectCourse,
                                        0,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(selectCourseLabel)
                            .addComponent(
                                selectCourse,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jPanel10,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addContainerGap()));
  }
コード例 #11
0
  protected void setLayout(final Editor editor, boolean activateErrorPanel, boolean isLoading) {
    if (progressBar == null) {
      progressBar = new JProgressBar();
      progressBar.setVisible(false);

      createComponents();
      buildErrorPanel();

      loaderLabel = new JLabel(Toolkit.getLibIcon("manager/loader.gif"));
      loaderLabel.setOpaque(false);
      loaderLabel.setBackground(Color.WHITE);
    }

    int scrollBarWidth =
        contributionListPanel.scrollPane.getVerticalScrollBar().getPreferredSize().width;

    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    //    layout.setAutoCreateContainerGaps(true);
    //    layout.setAutoCreateGaps(true);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.CENTER)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(ContributionManagerDialog.STATUS_WIDTH)
                    .addComponent(
                        filterField,
                        ContributionManagerDialog.FILTER_WIDTH,
                        ContributionManagerDialog.FILTER_WIDTH,
                        ContributionManagerDialog.FILTER_WIDTH)
                    //                  .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addPreferredGap(
                        LayoutStyle.ComponentPlacement.RELATED,
                        GroupLayout.PREFERRED_SIZE,
                        Short.MAX_VALUE)
                    .addComponent(
                        categoryChooser,
                        ContributionManagerDialog.AUTHOR_WIDTH,
                        ContributionManagerDialog.AUTHOR_WIDTH,
                        ContributionManagerDialog.AUTHOR_WIDTH)
                    .addGap(scrollBarWidth))
            .addComponent(loaderLabel)
            .addComponent(contributionListPanel)
            .addComponent(errorPanel)
            .addComponent(statusPanel));

    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addContainerGap()
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(categoryChooser)
                    .addComponent(filterField))
            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.CENTER)
                    .addComponent(loaderLabel)
                    .addComponent(contributionListPanel))
            .addComponent(errorPanel)
            .addComponent(
                statusPanel,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.PREFERRED_SIZE));
    layout.linkSize(SwingConstants.VERTICAL, categoryChooser, filterField);

    // these will occupy space even if not visible
    layout.setHonorsVisibility(contributionListPanel, false);
    layout.setHonorsVisibility(categoryChooser, false);

    setBackground(Color.WHITE);
    setBorder(null);
  }
コード例 #12
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() {

    yesjButton = new javax.swing.JButton();
    nojButton = new javax.swing.JButton();
    confirmDeleteUserjLabel = new javax.swing.JLabel();

    setTitle("iCrossFit - Confirm Delete User");
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
          }
        });

    yesjButton.setText("Yes");
    yesjButton.setToolTipText("Click to confirm.");
    yesjButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            yesjButtonActionPerformed(evt);
          }
        });

    nojButton.setText("No");
    nojButton.setToolTipText("Click to return to the previous screen.");
    nojButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            nojButtonActionPerformed(evt);
          }
        });

    confirmDeleteUserjLabel.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    confirmDeleteUserjLabel.setText("Are you sure you want to delete this user?");

    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.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        yesjButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        67,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(nojButton))
                            .addComponent(confirmDeleteUserjLabel))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {nojButton, yesjButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(confirmDeleteUserjLabel)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(nojButton)
                            .addComponent(yesjButton))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    getRootPane().setDefaultButton(yesjButton);

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #13
0
ファイル: Main.java プロジェクト: gacxanh/java
  /**
   * 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() {

    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Product Management");
    setResizable(false);

    jButton1.setText("Product Management");
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });

    jButton2.setText("Order Administration");
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });

    jButton3.setText("Exit");
    jButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
          }
        });

    jButton4.setText("About Us!");
    jButton4.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(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)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jButton1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        188,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        jButton2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        188,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jButton4)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        jButton3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        123,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jButton3, jButton4});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jButton2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                188,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jButton1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                188,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jButton3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                55,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton4))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButton3, jButton4});

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #14
0
  /**
   * This method is called from within the constructor to initialise 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();
    dayInput = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    monthInput = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    yearInput = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    hourInput = new javax.swing.JTextField();
    jLabel5 = new javax.swing.JLabel();
    minutesInput = new javax.swing.JTextField();
    jLabel6 = new javax.swing.JLabel();
    secondsInput = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    categoryChooser = new javax.swing.JComboBox();
    jLabel8 = new javax.swing.JLabel();
    outgoInput = new javax.swing.JTextField();
    jLabel9 = new javax.swing.JLabel();
    incomeInput = new javax.swing.JTextField();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    approveButton = new javax.swing.JButton();
    jLabel12 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    descriptionInput = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setModal(true);

    jLabel1.setText("Datum");

    dayInput.setToolTipText("Tag");
    dayInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel2.setText(".");

    monthInput.setToolTipText("Monat");
    monthInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel3.setText(".");

    yearInput.setToolTipText("Jahr");
    yearInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel4.setText("Uhrzeit");

    hourInput.setToolTipText("Stunde");
    hourInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel5.setText(":");

    minutesInput.setToolTipText("Minute");
    minutesInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel6.setText(":");

    secondsInput.setToolTipText("Sekunde");
    secondsInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel7.setText("Kategorie");

    categoryChooser.setToolTipText("Kategorie aus der Liste wählen.");

    jLabel8.setFont(new java.awt.Font("Ubuntu", 1, 15));
    jLabel8.setText("Ausgaben");

    outgoInput.setToolTipText("Für diesen Vorgang ausgegebenes Geld.");
    outgoInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel9.setFont(new java.awt.Font("Ubuntu", 1, 15));
    jLabel9.setText("Einnahmen");

    incomeInput.setToolTipText("Durch diesen Vorgang eingenommenes Geld.");
    incomeInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel10.setText("€");

    jLabel11.setText("€");

    approveButton.setText("Absenden");
    approveButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(evt);
          }
        });

    jLabel12.setFont(new java.awt.Font("Ubuntu", 1, 15));
    jLabel12.setText("-");

    jLabel13.setFont(new java.awt.Font("Ubuntu", 1, 15));
    jLabel13.setText("+");

    jLabel14.setText("Beschreibung");

    descriptionInput.setToolTipText("Möglichst kurze Beschreibung des Vorgangs.");
    descriptionInput.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            send(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)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        dayInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(1, 1, 1)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        monthInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(2, 2, 2)
                                    .addComponent(jLabel3)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        yearInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        57,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel4)
                                    .addGap(3, 3, 3)
                                    .addComponent(
                                        hourInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        32,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(4, 4, 4)
                                    .addComponent(
                                        jLabel5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        minutesInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        32,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel6)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        secondsInput,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        29,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel14)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addComponent(jLabel8)
                                                            .addComponent(jLabel9))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addComponent(jLabel12)
                                                            .addComponent(jLabel13)))
                                            .addComponent(jLabel7))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGap(1, 1, 1)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING,
                                                                false)
                                                            .addComponent(incomeInput)
                                                            .addComponent(
                                                                outgoInput,
                                                                javax.swing.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                83,
                                                                Short.MAX_VALUE))
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addComponent(
                                                                jLabel11,
                                                                javax.swing.GroupLayout.Alignment
                                                                    .TRAILING)
                                                            .addComponent(
                                                                jLabel10,
                                                                javax.swing.GroupLayout.Alignment
                                                                    .TRAILING))
                                                    .addGap(138, 138, 138)
                                                    .addComponent(approveButton))
                                            .addComponent(categoryChooser, 0, 325, Short.MAX_VALUE)
                                            .addComponent(
                                                descriptionInput,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                325,
                                                Short.MAX_VALUE))))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {dayInput, hourInput, minutesInput, monthInput, secondsInput});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(
                                dayInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)
                            .addComponent(
                                monthInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(
                                yearInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4)
                            .addComponent(
                                hourInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5)
                            .addComponent(
                                minutesInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)
                            .addComponent(
                                secondsInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(
                                categoryChooser,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(
                                descriptionInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(13, 13, 13)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(jLabel12)
                            .addComponent(
                                outgoInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(approveButton)
                            .addComponent(jLabel13)
                            .addComponent(
                                incomeInput,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    layout.linkSize(
        javax.swing.SwingConstants.VERTICAL,
        new java.awt.Component[] {dayInput, hourInput, minutesInput, monthInput, secondsInput});

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #15
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() {

    memIDTxt = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    addButton3 = new javax.swing.JButton();
    EmialTxt = new javax.swing.JTextField();
    jButton5 = new javax.swing.JButton();
    jLabel3 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    depositTxt = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    mobTxl = new javax.swing.JTextField();
    nameTxt = new javax.swing.JTextField();
    jLabel10 = new javax.swing.JLabel();
    curTimeTxt = new javax.swing.JTextField();
    dobDate = new org.jdesktop.swingx.JXDatePicker();
    addButton4 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();

    memIDTxt.setFont(new java.awt.Font("Arial", 1, 18));
    memIDTxt.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            memIDTxtActionPerformed(evt);
          }
        });
    memIDTxt.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            memIDTxtKeyTyped(evt);
          }
        });

    jButton2.setFont(new java.awt.Font("Arial", 1, 24));
    jButton2.setText("Reset");
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });

    jLabel4.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel4.setText("Member Name");
    jLabel4.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    jLabel9.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel9.setText("Email ID");
    jLabel9.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    addButton3.setFont(new java.awt.Font("Arial", 1, 24));
    addButton3.setText("Calculate Bill");
    addButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButton3ActionPerformed(evt);
          }
        });

    EmialTxt.setFont(new java.awt.Font("Arial", 1, 18));
    EmialTxt.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            EmialTxtActionPerformed(evt);
          }
        });
    EmialTxt.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            EmialTxtFocusLost(evt);
          }
        });
    EmialTxt.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            EmialTxtKeyTyped(evt);
          }
        });

    jButton5.setFont(new java.awt.Font("Arial", 1, 24));
    jButton5.setText("Back");
    jButton5.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
          }
        });

    jLabel3.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel3.setText("Member ID");
    jLabel3.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    jLabel8.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel8.setText("Deposite");
    jLabel8.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    jLabel5.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel5.setText("DOB");
    jLabel5.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    depositTxt.setFont(new java.awt.Font("Arial", 1, 18));
    depositTxt.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            depositTxtFocusLost(evt);
          }
        });
    depositTxt.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            depositTxtKeyTyped(evt);
          }
        });

    jLabel7.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel7.setText("Mobile No.");
    jLabel7.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    mobTxl.setFont(new java.awt.Font("Arial", 1, 18));
    mobTxl.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mobTxlActionPerformed(evt);
          }
        });
    mobTxl.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            mobTxlFocusLost(evt);
          }
        });
    mobTxl.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            mobTxlKeyTyped(evt);
          }
        });

    nameTxt.setFont(new java.awt.Font("Arial", 1, 18));

    jLabel10.setFont(new java.awt.Font("Arial", 1, 18));
    jLabel10.setText("Current Time");
    jLabel10.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

    curTimeTxt.setFont(new java.awt.Font("Arial", 1, 18));
    curTimeTxt.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            curTimeTxtActionPerformed(evt);
          }
        });
    curTimeTxt.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            curTimeTxtFocusLost(evt);
          }
        });
    curTimeTxt.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            curTimeTxtKeyTyped(evt);
          }
        });

    dobDate.setFont(new java.awt.Font("Arial", 1, 24)); // NOI18N

    addButton4.setFont(new java.awt.Font("Arial", 1, 24));
    addButton4.setText("Start/Stop");
    addButton4.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButton4ActionPerformed(evt);
          }
        });

    jLabel1.setText("jLabel1");

    jLabel2.setText("jLabel1");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        jLabel1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        176,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        jLabel2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        176,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.LEADING,
                                layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel3,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(memIDTxt))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel4,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(nameTxt))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel5,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(
                                                dobDate,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel7,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(mobTxl))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel9,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(EmialTxt))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel8,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(depositTxt))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(218, 218, 218)
                                            .addComponent(
                                                jLabel10,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                151,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(6, 6, 6)
                                            .addComponent(curTimeTxt))
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addGap(222, 222, 222)
                                            .addComponent(
                                                addButton4,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                171,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(27, 27, 27)
                                            .addComponent(
                                                jButton5,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                127,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(
                                                jButton2,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                124,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18)
                                            .addComponent(
                                                addButton3,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                192,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGap(396, 396, 396)));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {addButton3, jButton2, jButton5});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(62, 62, 62)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                41,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                memIDTxt,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                43,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                41,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                nameTxt,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                43,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel5,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                41,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                dobDate,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                41,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel7,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                41,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                mobTxl,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                43,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(8, 8, 8)
                                    .addComponent(
                                        jLabel9,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        39,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        EmialTxt,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        43,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(8, 8, 8)
                                    .addComponent(
                                        jLabel8,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        39,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        depositTxt,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        43,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel10,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                39,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(1, 1, 1)
                                    .addComponent(
                                        curTimeTxt,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        36,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(11, 11, 11)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                addButton4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                45,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(
                                        jButton5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        45,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(
                                        jButton2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        45,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(
                                        addButton3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        45,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(31, 31, 31)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jLabel2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jLabel1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                44,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(130, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents
コード例 #16
0
ファイル: Options.java プロジェクト: BlackPheonix/XChat
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jTabbedPane1 = new javax.swing.JTabbedPane();
    ProfileTab = new javax.swing.JPanel();
    pro_pic_label = new javax.swing.JLabel();
    name_text = new javax.swing.JTextField();
    name_label = new javax.swing.JLabel();
    ChooseImage = new javax.swing.JButton();
    pro_pic_display = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    GeneralTab = new javax.swing.JPanel();
    Display_button = new javax.swing.JLabel();
    color_button = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    font_style_list = new javax.swing.JList();
    jScrollPane3 = new javax.swing.JScrollPane();
    font_size_list = new javax.swing.JList();
    jScrollPane4 = new javax.swing.JScrollPane();
    DisplayArea_text = new javax.swing.JTextArea();
    Font_size_label = new javax.swing.JLabel();
    Font_label = new javax.swing.JLabel();
    Font_Color_button = new javax.swing.JButton();
    ChatsTab = new javax.swing.JPanel();
    Backup_Button = new javax.swing.JLabel();
    Backup_textfield = new javax.swing.JTextField();
    backup_folder_button = new javax.swing.JButton();
    Backup_Chat_label = new javax.swing.JLabel();
    backup_chat_button = new javax.swing.JButton();
    NotificationsTab = new javax.swing.JPanel();
    Sound = new javax.swing.JCheckBox();
    jLabel1 = new javax.swing.JLabel();
    Download_Textfield = new javax.swing.JTextField();
    Download_button = new javax.swing.JButton();
    AboutTab = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    cancel_button = new javax.swing.JButton();
    Save_Exit = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    pro_pic_label.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    pro_pic_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    pro_pic_label.setText("Profile Picture");

    name_text.setText(xchat.my_name);
    name_text.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            name_textActionPerformed(evt);
          }
        });

    name_label.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    name_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    name_label.setText("Name");

    ChooseImage.setText("Choose Image");
    ChooseImage.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            ChooseImageMouseClicked(evt);
          }
        });
    ChooseImage.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ChooseImageActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout pro_pic_displayLayout = new javax.swing.GroupLayout(pro_pic_display);
    pro_pic_display.setLayout(pro_pic_displayLayout);
    pro_pic_displayLayout.setHorizontalGroup(
        pro_pic_displayLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE));
    pro_pic_displayLayout.setVerticalGroup(
        pro_pic_displayLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                jLabel2,
                javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                100,
                Short.MAX_VALUE));

    javax.swing.GroupLayout ProfileTabLayout = new javax.swing.GroupLayout(ProfileTab);
    ProfileTab.setLayout(ProfileTabLayout);
    ProfileTabLayout.setHorizontalGroup(
        ProfileTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                ProfileTabLayout.createSequentialGroup()
                    .addGap(30, 30, 30)
                    .addGroup(
                        ProfileTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(
                                ProfileTabLayout.createSequentialGroup()
                                    .addComponent(
                                        pro_pic_label,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        121,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        pro_pic_display,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        ChooseImage,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        159,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                ProfileTabLayout.createSequentialGroup()
                                    .addComponent(
                                        name_label,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        84,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        name_text,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        303,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(188, Short.MAX_VALUE)));
    ProfileTabLayout.setVerticalGroup(
        ProfileTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                ProfileTabLayout.createSequentialGroup()
                    .addGap(33, 33, 33)
                    .addGroup(
                        ProfileTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                name_label,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                33,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                name_text,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                33,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        ProfileTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                ChooseImage,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                34,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                pro_pic_display,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                pro_pic_label,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                33,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Profile", ProfileTab);

    Display_button.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    Display_button.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    Display_button.setText("Display");

    color_button.setText("Background Color");
    color_button.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            color_buttonActionPerformed(evt);
          }
        });

    font_style_list.setModel(
        new javax.swing.AbstractListModel() {
          String[] strings = {
            "Arial",
            "Bradley Hand ITC",
            "Castellar",
            "Chiller",
            "Comic Sans MS",
            "Courier New",
            "Lucida Calligraphy",
            "Papyrus",
            "Tahoma",
            "Times New Roman"
          };

          public int getSize() {
            return strings.length;
          }

          public Object getElementAt(int i) {
            return strings[i];
          }
        });
    font_style_list.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    font_style_list.setSelectedIndex(0);
    font_style_list.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            font_style_listValueChanged(evt);
          }
        });
    jScrollPane2.setViewportView(font_style_list);
    font_style_list.setSelectedIndex(0);

    font_size_list.setModel(
        new javax.swing.AbstractListModel() {
          String[] strings = {"very small", "small", "medium", "huge", "vey huge"};

          public int getSize() {
            return strings.length;
          }

          public Object getElementAt(int i) {
            return strings[i];
          }
        });
    font_size_list.setSelectedIndex(1);
    font_size_list.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            font_size_listValueChanged(evt);
          }
        });
    jScrollPane3.setViewportView(font_size_list);

    jScrollPane4.setHorizontalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    jScrollPane4.setVerticalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    DisplayArea_text.setEditable(false);
    DisplayArea_text.setColumns(20);
    DisplayArea_text.setRows(5);
    DisplayArea_text.setText("AaBbYyZz");
    DisplayArea_text.setAutoscrolls(false);
    DisplayArea_text.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    jScrollPane4.setViewportView(DisplayArea_text);

    Font_size_label.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    Font_size_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    Font_size_label.setText("Font size");

    Font_label.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    Font_label.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    Font_label.setText("Font ");

    Font_Color_button.setText("Font Color");
    Font_Color_button.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            Font_Color_buttonActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout GeneralTabLayout = new javax.swing.GroupLayout(GeneralTab);
    GeneralTab.setLayout(GeneralTabLayout);
    GeneralTabLayout.setHorizontalGroup(
        GeneralTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                GeneralTabLayout.createSequentialGroup()
                    .addGap(52, 52, 52)
                    .addGroup(
                        GeneralTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                color_button,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                147,
                                Short.MAX_VALUE)
                            .addComponent(
                                Display_button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                133,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                Font_Color_button,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addGap(36, 36, 36)
                    .addGroup(
                        GeneralTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                GeneralTabLayout.createSequentialGroup()
                                    .addComponent(
                                        jScrollPane2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        152,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(40, 40, 40)
                                    .addComponent(
                                        jScrollPane3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        100,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                jScrollPane4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                259,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(107, Short.MAX_VALUE))
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                GeneralTabLayout.createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(
                        Font_label,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        120,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(53, 53, 53)
                    .addComponent(
                        Font_size_label,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        120,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(97, 97, 97)));
    GeneralTabLayout.setVerticalGroup(
        GeneralTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                GeneralTabLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        GeneralTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                GeneralTabLayout.createSequentialGroup()
                                    .addComponent(
                                        Font_size_label,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(8, 8, 8)
                                    .addComponent(
                                        jScrollPane3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        84,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                GeneralTabLayout.createSequentialGroup()
                                    .addComponent(
                                        Font_label,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        27,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        GeneralTabLayout.createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                jScrollPane2,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                84,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(
                                                GeneralTabLayout.createSequentialGroup()
                                                    .addComponent(
                                                        color_button,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        36,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .UNRELATED)
                                                    .addComponent(
                                                        Font_Color_button,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        Short.MAX_VALUE)))))
                    .addGap(18, 18, 18)
                    .addGroup(
                        GeneralTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jScrollPane4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                51,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                Display_button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                40,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jTabbedPane1.addTab("General", GeneralTab);

    Backup_Button.setText("Backup Folder");

    Backup_textfield.setEditable(false);
    Backup_textfield.setText(xchat.path_save_chat);
    Backup_textfield.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            Backup_textfieldActionPerformed(evt);
          }
        });

    backup_folder_button.setText("Choose Folder");
    backup_folder_button.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            backup_folder_buttonActionPerformed(evt);
          }
        });

    Backup_Chat_label.setText("Backup Current Chat");

    backup_chat_button.setText("OK");
    backup_chat_button.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            backup_chat_buttonActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout ChatsTabLayout = new javax.swing.GroupLayout(ChatsTab);
    ChatsTab.setLayout(ChatsTabLayout);
    ChatsTabLayout.setHorizontalGroup(
        ChatsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                ChatsTabLayout.createSequentialGroup()
                    .addGap(57, 57, 57)
                    .addGroup(
                        ChatsTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                Backup_Chat_label,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                114,
                                Short.MAX_VALUE)
                            .addComponent(
                                Backup_Button,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        Backup_textfield,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        227,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(30, 30, 30)
                    .addComponent(
                        backup_folder_button,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        115,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(87, Short.MAX_VALUE))
            .addGroup(
                ChatsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                        ChatsTabLayout.createSequentialGroup()
                            .addGap(185, 185, 185)
                            .addComponent(
                                backup_chat_button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                102,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(347, Short.MAX_VALUE))));
    ChatsTabLayout.setVerticalGroup(
        ChatsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                ChatsTabLayout.createSequentialGroup()
                    .addGap(44, 44, 44)
                    .addGroup(
                        ChatsTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                Backup_Button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                37,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                Backup_textfield,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                37,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                backup_folder_button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                37,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                    .addComponent(
                        Backup_Chat_label,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        37,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(59, 59, 59))
            .addGroup(
                ChatsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                        javax.swing.GroupLayout.Alignment.TRAILING,
                        ChatsTabLayout.createSequentialGroup()
                            .addContainerGap(128, Short.MAX_VALUE)
                            .addComponent(
                                backup_chat_button,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                37,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(56, 56, 56))));

    jTabbedPane1.addTab("Chats ", ChatsTab);

    Sound.setSelected(true);
    Sound.setText("Sound");
    Sound.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SoundActionPerformed(evt);
          }
        });

    jLabel1.setText("Download Folder");

    Download_Textfield.setEditable(false);
    Download_Textfield.setText(xchat.path_save_download);

    Download_button.setText("Choose Folder");
    Download_button.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            Download_buttonActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout NotificationsTabLayout = new javax.swing.GroupLayout(NotificationsTab);
    NotificationsTab.setLayout(NotificationsTabLayout);
    NotificationsTabLayout.setHorizontalGroup(
        NotificationsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                NotificationsTabLayout.createSequentialGroup()
                    .addGap(36, 36, 36)
                    .addGroup(
                        NotificationsTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                NotificationsTabLayout.createSequentialGroup()
                                    .addComponent(
                                        jLabel1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        126,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        Download_Textfield,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        291,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        Download_button,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        123,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                Sound,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                146,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(36, Short.MAX_VALUE)));
    NotificationsTabLayout.setVerticalGroup(
        NotificationsTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                NotificationsTabLayout.createSequentialGroup()
                    .addGap(35, 35, 35)
                    .addComponent(
                        Sound,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        39,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        NotificationsTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                Download_button,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                34,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                Download_Textfield,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                34,
                                Short.MAX_VALUE))
                    .addContainerGap(108, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Sounds & Download", NotificationsTab);

    AboutTab.setAutoscrolls(true);
    AboutTab.setEnabled(false);

    jScrollPane1.setHorizontalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    jScrollPane1.setVerticalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    jScrollPane1.setOpaque(false);

    jTextArea1.setEditable(false);
    jTextArea1.setBackground(new java.awt.Color(240, 240, 240));
    jTextArea1.setColumns(20);
    jTextArea1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
    jTextArea1.setLineWrap(true);
    jTextArea1.setRows(5);
    jTextArea1.setText(
        "XChat is based on software from JAVA, which has been doubled licensed under the Narendari Modi Development and Distribution (NMDD) and the Barack Obama License (BOL) version 9.9.9.9.9.9... with Rahul Gandhi exception. For more information, please visit http://www.google.co.in/ ");
    jTextArea1.setWrapStyleWord(true);
    jTextArea1.setBorder(null);
    jTextArea1.setOpaque(false);
    jScrollPane1.setViewportView(jTextArea1);

    jLabel3.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/xchat/Barack Obama.jpg"))); // NOI18N

    jLabel4.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/xchat/X (2).jpg"))); // NOI18N

    jLabel5.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/xchat/Narendra-Modi-In-Brown-Coat.jpg"))); // NOI18N

    javax.swing.GroupLayout AboutTabLayout = new javax.swing.GroupLayout(AboutTab);
    AboutTab.setLayout(AboutTabLayout);
    AboutTabLayout.setHorizontalGroup(
        AboutTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                AboutTabLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        AboutTabLayout.createParallelGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jScrollPane1)
                            .addGroup(
                                AboutTabLayout.createSequentialGroup()
                                    .addComponent(
                                        jLabel5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        180,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(50, 50, 50)
                                    .addComponent(
                                        jLabel4,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        150,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        54,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        jLabel3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        180,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));

    AboutTabLayout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel3, jLabel5});

    AboutTabLayout.setVerticalGroup(
        AboutTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                AboutTabLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        AboutTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                            .addComponent(
                                jLabel3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                90,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jLabel5,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                90,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jLabel4,
                                javax.swing.GroupLayout.Alignment.LEADING,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                90,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        80,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    AboutTabLayout.linkSize(
        javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel3, jLabel5});

    jTabbedPane1.addTab("About", AboutTab);

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

    Save_Exit.setText("Save and Exit");
    Save_Exit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            Save_ExitActionPerformed(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)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(
                                        Save_Exit,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        114,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        cancel_button,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        99,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jTabbedPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        230,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                cancel_button,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                35,
                                Short.MAX_VALUE)
                            .addComponent(
                                Save_Exit,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #17
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    dirTF = new javax.swing.JTextField();
    portTF = new javax.swing.JTextField();
    connProgress = new javax.swing.JProgressBar();
    statusLabel = new javax.swing.JLabel();

    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle("com/angelcalvo/superpalitos/gui/Bundle"); // NOI18N
    setTitle(bundle.getString("connDialog.title")); // NOI18N
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
          }
        });

    okButton.setIcon(okImg); // NOI18N
    okButton.setText(bundle.getString("connDialog.ok")); // NOI18N
    okButton.addActionListener(
        e -> {
          okButtonActionPerformed(e);
        });

    cancelButton.setIcon(cancelImg); // NOI18N
    cancelButton.setText(bundle.getString("connDialog.cancel")); // NOI18N
    cancelButton.addActionListener(
        e -> {
          cancelButtonActionPerformed(e);
        });

    jLabel1.setText(bundle.getString("connDialog.dir")); // NOI18N

    jLabel2.setText(bundle.getString("connDialog.port")); // NOI18N

    statusLabel.setText(bundle.getString("connDialog.connecting")); // NOI18N

    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)
                            .addComponent(
                                jSeparator1,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                291,
                                Short.MAX_VALUE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        okButton,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        67,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(cancelButton))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel1)
                                            .addComponent(jLabel2))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                portTF,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                97,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                dirTF,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                225,
                                                Short.MAX_VALUE)))
                            .addComponent(
                                connProgress,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                291,
                                Short.MAX_VALUE)
                            .addComponent(statusLabel))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, okButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(
                                dirTF,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(
                                portTF,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
                    .addComponent(statusLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        connProgress,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jSeparator1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton))
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #18
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() {

    jScrollPane4 = new javax.swing.JScrollPane();
    tbSolicitacao = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    btRelatorio = new javax.swing.JButton();
    jLabel7 = new javax.swing.JLabel();
    jDesktopPane1 = new javax.swing.JDesktopPane();
    jLabel10 = new javax.swing.JLabel();
    jPDepartamento = new javax.swing.JPanel();
    lbDistribuir = new javax.swing.JLabel();
    lbGeral = new javax.swing.JLabel();
    lbPerfil = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();
    jComboBox1 = new javax.swing.JComboBox<>();

    setBackground(new java.awt.Color(250, 250, 250));
    setBorder(null);
    setPreferredSize(new java.awt.Dimension(860, 600));
    addComponentListener(
        new java.awt.event.ComponentAdapter() {
          public void componentMoved(java.awt.event.ComponentEvent evt) {
            formComponentMoved(evt);
          }
        });

    tbSolicitacao.setBackground(new java.awt.Color(250, 250, 250));
    tbSolicitacao.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {}, new String[] {"Aguardando Validação"}) {

          boolean[] canEdit = new boolean[] {false};

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    jScrollPane4.setViewportView(tbSolicitacao);

    jButton1.setText("Visualizar Tela");
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });

    jButton2.setText("Visualizar Tela");
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });

    jButton3.setText("Gerar Alerta");
    jButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
          }
        });

    btRelatorio.setText("Relatório");

    jLabel7.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
    jLabel7.setText("Documentos:");

    jDesktopPane1.setBackground(new java.awt.Color(250, 250, 250));
    jDesktopPane1.setPreferredSize(new java.awt.Dimension(500, 245));

    javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
    jDesktopPane1.setLayout(jDesktopPane1Layout);
    jDesktopPane1Layout.setHorizontalGroup(
        jDesktopPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 500, Short.MAX_VALUE));
    jDesktopPane1Layout.setVerticalGroup(
        jDesktopPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE));

    jLabel10.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
    jLabel10.setText("Controle:");

    jPDepartamento.setBackground(new java.awt.Color(250, 250, 250));
    jPDepartamento.setAutoscrolls(true);

    lbDistribuir.setBackground(new java.awt.Color(250, 250, 250));
    lbDistribuir.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
    lbDistribuir.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    lbDistribuir.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    lbDistribuir.setOpaque(true);
    lbDistribuir.setPreferredSize(new java.awt.Dimension(0, 22));

    lbGeral.setBackground(new java.awt.Color(250, 250, 250));
    lbGeral.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
    lbGeral.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    lbGeral.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    lbGeral.setOpaque(true);

    lbPerfil.setBackground(new java.awt.Color(250, 250, 250));
    lbPerfil.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
    lbPerfil.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    lbPerfil.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    lbPerfil.setOpaque(true);
    lbPerfil.setPreferredSize(new java.awt.Dimension(0, 22));

    javax.swing.GroupLayout jPDepartamentoLayout = new javax.swing.GroupLayout(jPDepartamento);
    jPDepartamento.setLayout(jPDepartamentoLayout);
    jPDepartamentoLayout.setHorizontalGroup(
        jPDepartamentoLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                jPDepartamentoLayout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        jPDepartamentoLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                lbGeral,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                80,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                lbDistribuir,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                80,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                lbPerfil,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                80,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    jPDepartamentoLayout.setVerticalGroup(
        jPDepartamentoLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPDepartamentoLayout
                    .createSequentialGroup()
                    .addComponent(
                        lbGeral,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        22,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, Short.MAX_VALUE)
                    .addComponent(
                        lbDistribuir,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        22,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        lbPerfil,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        22,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(223, 223, 223)));

    jLabel11.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
    jLabel11.setText("Distribuir para Funcionário:");

    jLabel12.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
    jLabel12.setText("Validar Perfil Fiscal");

    jLabel1.setBackground(new java.awt.Color(250, 250, 250));
    jLabel1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Fiscal");
    jLabel1.setOpaque(true);

    jComboBox1.setBackground(new java.awt.Color(250, 250, 250));
    jComboBox1.addItemListener(
        new java.awt.event.ItemListener() {
          public void itemStateChanged(java.awt.event.ItemEvent evt) {
            jComboBox1ItemStateChanged(evt);
          }
        });
    jComboBox1.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            jComboBox1FocusLost(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                jLabel1,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jComboBox1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        298,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(
                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel11)
                                            .addComponent(jLabel12)
                                            .addComponent(jLabel10)
                                            .addComponent(jButton1))
                                    .addGap(34, 34, 34)
                                    .addComponent(
                                        jPDepartamento,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        jDesktopPane1,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(0, 0, Short.MAX_VALUE))
                                            .addGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                layout
                                                    .createSequentialGroup()
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .TRAILING)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addGap(0, 0, Short.MAX_VALUE)
                                                                    .addGroup(
                                                                        layout
                                                                            .createParallelGroup(
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addComponent(
                                                                                jScrollPane4,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                252,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addComponent(jLabel7)))
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addGap(137, 137, 137)
                                                                    .addComponent(
                                                                        jButton2,
                                                                        javax.swing.GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        128,
                                                                        Short.MAX_VALUE)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(
                                                                        jButton3,
                                                                        javax.swing.GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        121,
                                                                        Short.MAX_VALUE)))
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        btRelatorio,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        117,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(23, 23, 23)))));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jComboBox1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jLabel1)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(jLabel10)
                                                    .addGap(47, 47, 47)
                                                    .addComponent(jLabel11)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .UNRELATED)
                                                    .addComponent(jLabel12))
                                            .addComponent(
                                                jPDepartamento,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(24, 24, 24)
                                    .addComponent(jButton1))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel7)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        jScrollPane4,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        145,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButton3)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(
                                                        btRelatorio,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        41,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(
                                                        jButton2,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        40,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        jDesktopPane1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        250,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))));

    layout.linkSize(
        javax.swing.SwingConstants.VERTICAL,
        new java.awt.Component[] {btRelatorio, jButton1, jButton2, jButton3});

    setBounds(0, 0, 860, 600);
  } // </editor-fold>//GEN-END:initComponents
コード例 #19
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() {

    jScrollPane1 = new javax.swing.JScrollPane();
    spinXMAX = new javax.swing.JSpinner();
    spinYMAX = new javax.swing.JSpinner();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    butBuscar = new javax.swing.JButton();
    spinXTarget = new javax.swing.JSpinner();
    spinYTarget = new javax.swing.JSpinner();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("rC Vasijas");

    spinXMAX.setModel(new javax.swing.SpinnerNumberModel(4, 0, 1000, 1));

    spinYMAX.setModel(new javax.swing.SpinnerNumberModel(3, 1, 1000, 1));

    jLabel1.setText("X_MAX");

    jLabel2.setText("Y_MAX");

    butBuscar.setText("Buscar");
    butBuscar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            butBuscarActionPerformed(evt);
          }
        });

    spinXTarget.setModel(new javax.swing.SpinnerNumberModel(2, -1, 1000, 1));

    spinYTarget.setModel(new javax.swing.SpinnerNumberModel(-1, -1, 1000, 1));

    jLabel3.setText("X_Objetivo");

    jLabel4.setText("Y_Objetivo");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        754,
                                        Short.MAX_VALUE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(28, 28, 28)
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        spinXMAX,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        64,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        spinYMAX,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(42, 42, 42)
                                    .addComponent(jLabel3)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        spinXTarget,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(13, 13, 13)
                                    .addComponent(jLabel4)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        spinYTarget,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(butBuscar)))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {spinXMAX, spinXTarget, spinYMAX, spinYTarget});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(15, 15, 15)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                spinXMAX,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(butBuscar)
                            .addComponent(
                                spinXTarget,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                spinYTarget,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel2)
                            .addComponent(
                                spinYMAX,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #20
0
ファイル: ShoppingListPage.java プロジェクト: YArane/ECSE_429
  /** This method is called from within the constructor to initialize the form. */
  private void initComponents() {
    // name of application
    title = new JLabel();
    title.setFont(new Font("Serif", Font.BOLD, 24));

    // elements for error message
    errorMessage = new JLabel();
    errorMessage.setForeground(Color.RED);

    // elements for registration
    itemList = new JComboBox<String>(new String[0]);
    itemList.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            JComboBox<String> cb = (JComboBox<String>) evt.getSource();
            selectedItem = cb.getSelectedIndex();
          }
        });
    itemLabel = new JLabel();
    storeVisitList = new JComboBox<String>(new String[0]);
    storeVisitList.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            JComboBox<String> cb = (JComboBox<String>) evt.getSource();
            selectedStoreVisit = cb.getSelectedIndex();
          }
        });
    storeVisitLabel = new JLabel();

    addToShoppingListButton = new JButton();
    separator1 = new JSeparator(SwingConstants.HORIZONTAL);

    // elements for participant
    itemNameTextField = new JTextField();
    itemNameLabel = new JLabel();
    addItemButton = new JButton();
    separator2 = new JSeparator(SwingConstants.HORIZONTAL);

    // elements for event
    storeVisitNameTextField = new JTextField();
    storeVisitNameLabel = new JLabel();

    SqlDateModel model = new SqlDateModel();
    Properties p = new Properties();
    p.put("text.today", "Today");
    p.put("text.month", "Month");
    p.put("text.year", "Year");
    JDatePanelImpl datePanel = new JDatePanelImpl(model, p);
    storeVisitDatePicker = new JDatePickerImpl(datePanel, new DateLabelFormatter());

    storeVisitDateLabel = new JLabel();
    storeVisitStartTimeSpinner = new JSpinner(new SpinnerDateModel());
    JSpinner.DateEditor startTimeEditor =
        new JSpinner.DateEditor(storeVisitStartTimeSpinner, "HH:mm");
    storeVisitStartTimeSpinner.setEditor(startTimeEditor); // will only show the current time
    storevisitStartTimeLabel = new JLabel();
    storeVisitEndTimeSpinner = new JSpinner(new SpinnerDateModel());
    JSpinner.DateEditor endTimeEditor = new JSpinner.DateEditor(storeVisitEndTimeSpinner, "HH:mm");
    storeVisitEndTimeSpinner.setEditor(endTimeEditor); // will only show the current time
    storeVisitEndTimeLabel = new JLabel();
    addStoreVisitButton = new JButton();

    // global settings and listeners
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setTitle("Shopping List");

    title.setText("Shopping List:");
    itemLabel.setText("Select Item:");
    storeVisitLabel.setText("Select Store Visit:");
    addToShoppingListButton.setText("Add to Shopping List");
    addToShoppingListButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addToShoppingListButtonActionPerformed(evt);
          }
        });

    itemNameLabel.setText("Name:");
    addItemButton.setText("Add Item");
    addItemButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addItemButtonActionPerformed(evt);
          }
        });

    storeVisitNameLabel.setText("Name:");
    storeVisitDateLabel.setText("Date:");
    storevisitStartTimeLabel.setText("Start Time:");
    storeVisitEndTimeLabel.setText("End time:");
    addStoreVisitButton.setText("Add Store Visit");
    addStoreVisitButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addStoreVisitButtonActionPerformed(evt);
          }
        });

    // layout
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup()
            .addComponent(title)
            .addComponent(errorMessage)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(itemLabel)
                            .addComponent(storeVisitLabel))
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(itemList)
                            .addComponent(storeVisitList)
                            .addComponent(addToShoppingListButton)))
            .addComponent(separator1)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(itemNameLabel)
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(itemNameTextField, 200, 200, 400)
                            .addComponent(addItemButton)))
            .addComponent(separator2)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(storeVisitNameLabel)
                            .addComponent(storeVisitDateLabel)
                            .addComponent(storevisitStartTimeLabel)
                            .addComponent(storeVisitEndTimeLabel))
                    .addGroup(
                        layout
                            .createParallelGroup()
                            .addComponent(storeVisitNameTextField, 200, 200, 400)
                            .addComponent(storeVisitDatePicker)
                            .addComponent(storeVisitStartTimeSpinner)
                            .addComponent(storeVisitEndTimeSpinner)
                            .addComponent(addStoreVisitButton))));

    layout.linkSize(
        SwingConstants.HORIZONTAL,
        new java.awt.Component[] {
          itemList,
          storeVisitList,
          addToShoppingListButton,
          itemNameTextField,
          addItemButton,
          storeVisitNameTextField,
          storeVisitDatePicker,
          storeVisitStartTimeSpinner,
          storeVisitEndTimeSpinner,
          addStoreVisitButton
        });
    layout.linkSize(
        SwingConstants.HORIZONTAL,
        new java.awt.Component[] {storeVisitLabel, itemNameLabel, storeVisitNameLabel});

    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addComponent(title)
            .addComponent(errorMessage)
            .addGroup(layout.createParallelGroup().addComponent(itemLabel).addComponent(itemList))
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(storeVisitLabel)
                    .addComponent(storeVisitList))
            .addComponent(addToShoppingListButton)
            .addComponent(separator1)
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(itemNameLabel)
                    .addComponent(itemNameTextField))
            .addComponent(addItemButton)
            .addComponent(separator2)
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(storeVisitNameLabel)
                    .addComponent(storeVisitNameTextField))
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(storeVisitDateLabel)
                    .addComponent(storeVisitDatePicker))
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(storevisitStartTimeLabel)
                    .addComponent(storeVisitStartTimeSpinner))
            .addGroup(
                layout
                    .createParallelGroup()
                    .addComponent(storeVisitEndTimeLabel)
                    .addComponent(storeVisitEndTimeSpinner))
            .addComponent(addStoreVisitButton));

    pack();
  }
コード例 #21
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    paintedPanel1 = new aurelienribon.ui.components.PaintedPanel();
    cancelBtn = new javax.swing.JButton();
    okBtn = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    imgPointRadio = new javax.swing.JRadioButton();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    nameField = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    imgDiscRadio = new javax.swing.JRadioButton();
    imgHaloRadio = new javax.swing.JRadioButton();
    jLabel5 = new javax.swing.JLabel();
    imgSquareRadio = new javax.swing.JRadioButton();
    jLabel6 = new javax.swing.JLabel();
    imgFireRadio = new javax.swing.JRadioButton();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    imgCustomRadio = new javax.swing.JRadioButton();
    imgCustomField = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("New Emitter");

    cancelBtn.setText("Cancel");

    okBtn.setText("Ok");

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel1.setText("Particle image");

    buttonGroup1.add(imgPointRadio);
    imgPointRadio.setSelected(true);
    imgPointRadio.setText("Point");

    jLabel2.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/particles/point.png"))); // NOI18N

    jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel3.setText("Emitter name");

    jLabel4.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/particles/disc.png"))); // NOI18N

    buttonGroup1.add(imgDiscRadio);
    imgDiscRadio.setText("Disc");

    buttonGroup1.add(imgHaloRadio);
    imgHaloRadio.setText("Halo");

    jLabel5.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/particles/halo.png"))); // NOI18N

    buttonGroup1.add(imgSquareRadio);
    imgSquareRadio.setText("Square");

    jLabel6.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/particles/square.png"))); // NOI18N

    buttonGroup1.add(imgFireRadio);
    imgFireRadio.setText("Fire");

    jLabel7.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/particles/fire.png"))); // NOI18N

    jLabel8.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/res/gfx/effect1.png"))); // NOI18N
    jLabel8.setVerticalAlignment(javax.swing.SwingConstants.TOP);

    buttonGroup1.add(imgCustomRadio);
    imgCustomRadio.setText("Custom");

    imgCustomField.setText("<atlas region name>");

    javax.swing.GroupLayout paintedPanel1Layout = new javax.swing.GroupLayout(paintedPanel1);
    paintedPanel1.setLayout(paintedPanel1Layout);
    paintedPanel1Layout.setHorizontalGroup(
        paintedPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                paintedPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel8)
                    .addGap(18, 18, 18)
                    .addGroup(
                        paintedPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                paintedPanel1Layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(
                                        okBtn,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        80,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        cancelBtn,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        80,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                paintedPanel1Layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel1))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(nameField)
                                            .addGroup(
                                                paintedPanel1Layout
                                                    .createSequentialGroup()
                                                    .addGroup(
                                                        paintedPanel1Layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING,
                                                                false)
                                                            .addGroup(
                                                                paintedPanel1Layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(imgCustomRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(imgCustomField))
                                                            .addGroup(
                                                                paintedPanel1Layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(imgPointRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(jLabel2)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(imgDiscRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(jLabel4)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(imgHaloRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(jLabel5))
                                                            .addGroup(
                                                                paintedPanel1Layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(imgSquareRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(jLabel6)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(imgFireRadio)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(jLabel7)))
                                                    .addGap(0, 0, Short.MAX_VALUE)))))
                    .addContainerGap()));

    paintedPanel1Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelBtn, okBtn});

    paintedPanel1Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel3});

    paintedPanel1Layout.setVerticalGroup(
        paintedPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                paintedPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        paintedPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jLabel8,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                paintedPanel1Layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel3)
                                            .addComponent(
                                                nameField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.CENTER)
                                            .addComponent(jLabel1)
                                            .addComponent(imgPointRadio)
                                            .addComponent(jLabel2)
                                            .addComponent(jLabel5)
                                            .addComponent(imgHaloRadio)
                                            .addComponent(jLabel4)
                                            .addComponent(imgDiscRadio))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.CENTER)
                                            .addComponent(jLabel6)
                                            .addComponent(imgSquareRadio)
                                            .addComponent(jLabel7)
                                            .addComponent(imgFireRadio))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.CENTER)
                                            .addComponent(
                                                imgCustomField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(imgCustomRadio))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        paintedPanel1Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(cancelBtn)
                                            .addComponent(okBtn))))
                    .addContainerGap()));

    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()
                    .addComponent(
                        paintedPanel1,
                        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(
                        paintedPanel1,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #22
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    filterComboBox = new javax.swing.JComboBox();

    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
          }
        });

    okButton.setText("OK");
    okButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(evt);
          }
        });

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

    jLabel1.setText("What kind of filter would you like to add?");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap(65, Short.MAX_VALUE)
                    .addComponent(
                        okButton,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        67,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cancelButton)
                    .addContainerGap())
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                filterComboBox,
                                0,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(jLabel1))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, okButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        filterComboBox,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton))
                    .addContainerGap()));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #23
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() {

    jPanel1 = new javax.swing.JPanel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jTextField3 = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jPanel1.setBorder(
        new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

    jLabel2.setText("Name:");

    jLabel3.setText("Surname:");

    jLabel4.setText("Address:");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4))
                    .addGap(45, 45, 45)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jTextField3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jTextField2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jTextField1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                140,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel1Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {jTextField1, jTextField2, jTextField3});

    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap(27, Short.MAX_VALUE)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jTextField1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jTextField2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jTextField3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                    .addContainerGap()));

    jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
    jLabel1.setText("Enter new customer data");

    jButton1.setText("Save");
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(
                        jButton1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        95,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(24, 24, 24))
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.Alignment.LEADING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 157, Short.MAX_VALUE)
                                    .addComponent(jLabel1)))
                    .addGap(21, 21, 21)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(
                        jLabel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        21,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(29, 29, 29)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(47, 47, 47)
                    .addComponent(jButton1)
                    .addGap(31, 31, 31)));

    pack();
  } // </editor-fold>//GEN-END:initComponents
  @SuppressWarnings({"rawtypes", "unchecked"})
  public void initGUI() {

    JPanel gsPanel = new JPanel();
    gsPanel.setBorder(BorderFactory.createTitledBorder(""));

    JPanel generalSpecificPanel = new JPanel();
    generalSpecificPanel.setBorder(BorderFactory.createTitledBorder(""));

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout
            .createParallelGroup(Alignment.TRAILING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        groupLayout
                            .createParallelGroup(Alignment.TRAILING)
                            .addComponent(
                                gsPanel,
                                Alignment.LEADING,
                                GroupLayout.DEFAULT_SIZE,
                                430,
                                Short.MAX_VALUE)
                            .addComponent(
                                generalSpecificPanel,
                                Alignment.LEADING,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    groupLayout.setVerticalGroup(
        groupLayout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                groupLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        generalSpecificPanel,
                        GroupLayout.PREFERRED_SIZE,
                        70,
                        GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(gsPanel, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE)
                    .addGap(11)));

    JLabel lblSpecific = new JLabel("Specific:");

    specificCombo = new JComboBox();
    specificCombo.setPreferredSize(new Dimension(350, 20));
    specificCombo.addItem(
        getStereotype(element.getSpecific()) + " " + element.getSpecific().getName());

    JLabel lblGeneral = new JLabel("General:");

    generalCombo = new JComboBox();
    generalCombo.setPreferredSize(new Dimension(350, 20));
    GroupLayout gl_generalSpecificPanel = new GroupLayout(generalSpecificPanel);
    gl_generalSpecificPanel.setHorizontalGroup(
        gl_generalSpecificPanel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_generalSpecificPanel
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_generalSpecificPanel
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(lblGeneral)
                            .addComponent(lblSpecific))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(
                        gl_generalSpecificPanel
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(specificCombo, 0, 355, Short.MAX_VALUE)
                            .addComponent(generalCombo, 0, 355, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_generalSpecificPanel.setVerticalGroup(
        gl_generalSpecificPanel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_generalSpecificPanel
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_generalSpecificPanel
                            .createParallelGroup(Alignment.BASELINE)
                            .addComponent(
                                generalCombo,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblGeneral))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(
                        gl_generalSpecificPanel
                            .createParallelGroup(Alignment.BASELINE)
                            .addComponent(
                                specificCombo,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblSpecific))
                    .addGap(20)));
    gl_generalSpecificPanel.linkSize(
        SwingConstants.HORIZONTAL, new Component[] {lblSpecific, lblGeneral});
    generalSpecificPanel.setLayout(gl_generalSpecificPanel);

    JLabel lblThisGeneralizationParticipates = new JLabel("Participating generalization sets :");

    genSetModel = new DefaultListModel();
    for (GeneralizationSet gs : element.getGeneralizationSet()) {
      genSetModel.addElement(new OntoUMLElement(gs, ""));
    }
    genSetList = new JList<OntoUMLElement>(genSetModel);

    scrollPane = new JScrollPane(genSetList);

    btnRemove = new JButton("");
    btnRemove.setIcon(
        new ImageIcon(
            GeneralizationEditionPanel.class.getResource("/resources/icons/x16/cross.png")));
    btnRemove.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            if (genSetModel.size() > 0) {
              OntoUMLElement genSet = (OntoUMLElement) genSetList.getSelectedValue();

              ((GeneralizationSet) genSet.getElement()).getGeneralization().remove(element);
              element.getGeneralizationSet().remove(genSet.getElement());

              genSetModel.removeElement(genSetList.getSelectedValue());
            }
          }
        });

    btnAdd = new JButton("");
    btnAdd.setIcon(
        new ImageIcon(
            GeneralizationEditionPanel.class.getResource("/resources/icons/x16/add.png")));
    btnAdd.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            OntoUMLParser refparser =
                diagramManager.getFrame().getBrowserManager().getProjectBrowser().getParser();
            ArrayList<OntoUMLElement> genSetList = new ArrayList<OntoUMLElement>();
            for (GeneralizationSet gs : refparser.getAllInstances(GeneralizationSet.class)) {
              if (!(element.getGeneralizationSet().contains(gs)))
                genSetList.add(new OntoUMLElement(gs, ""));
            }
            if (genSetList.size() == 0) {
              JOptionPane.showMessageDialog(
                  GeneralizationEditionPanel.this,
                  "No generalization set left in the model.",
                  "Add",
                  JOptionPane.INFORMATION_MESSAGE);
            } else {
              OntoUMLElement genSet =
                  (OntoUMLElement)
                      JOptionPane.showInputDialog(
                          GeneralizationEditionPanel.this,
                          "To which generalization set do you want to include "
                              + element.getSpecific().getName()
                              + "->"
                              + element.getGeneral().getName(),
                          "Add",
                          JOptionPane.QUESTION_MESSAGE,
                          null,
                          genSetList.toArray(),
                          genSetList.toArray()[0]);
              if (genSet != null) {
                genSetModel.addElement(genSet);

                ((GeneralizationSet) genSet.getElement()).getGeneralization().add(element);
                element.getGeneralizationSet().add((GeneralizationSet) genSet.getElement());
              }
            }
          }
        });

    btnNew = new JButton("");
    btnNew.setIcon(
        new ImageIcon(
            GeneralizationEditionPanel.class.getResource("/resources/icons/x16/new.png")));
    btnNew.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            int response =
                JOptionPane.showConfirmDialog(
                    GeneralizationEditionPanel.this,
                    "Are you sure you want to create a new generalization set?",
                    "Creating Generalization Set",
                    JOptionPane.YES_NO_OPTION,
                    JOptionPane.QUESTION_MESSAGE);
            if (response == JOptionPane.OK_OPTION) {
              PackageableElement genSet =
                  (PackageableElement)
                      diagramManager.addElement(
                          ElementType.GENERALIZATIONSET,
                          (RefOntoUML.Package) element.eContainer().eContainer());
              genSet.setName("gs");
              ((GeneralizationSet) genSet).setIsCovering(true);
              ((GeneralizationSet) genSet).setIsDisjoint(true);
              ((GeneralizationSet) genSet).getGeneralization().add(element);
              element.getGeneralizationSet().add((GeneralizationSet) genSet);
              ElementDialogCaller.callGeneralizationSetDialog(
                  diagramManager.getFrame(), (GeneralizationSet) genSet, true);
              genSetModel.addElement(new OntoUMLElement(genSet, ""));
            }
          }
        });

    btnEdit = new JButton("");
    btnEdit.setIcon(
        new ImageIcon(
            GeneralizationEditionPanel.class.getResource("/resources/icons/x16/pencil.png")));
    btnEdit.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            if (genSetModel.size() > 0) {
              GeneralizationSet genSet =
                  (GeneralizationSet) ((OntoUMLElement) genSetList.getSelectedValue()).getElement();
              ElementDialogCaller.callGeneralizationSetDialog(
                  diagramManager.getFrame(), genSet, true);
            }
          }
        });

    GroupLayout gl_gsPanel = new GroupLayout(gsPanel);
    gl_gsPanel.setHorizontalGroup(
        gl_gsPanel
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                gl_gsPanel
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        gl_gsPanel
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                gl_gsPanel
                                    .createSequentialGroup()
                                    .addGroup(
                                        gl_gsPanel
                                            .createParallelGroup(Alignment.TRAILING)
                                            .addGroup(
                                                gl_gsPanel
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        lblThisGeneralizationParticipates,
                                                        GroupLayout.PREFERRED_SIZE,
                                                        243,
                                                        GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        ComponentPlacement.RELATED,
                                                        46,
                                                        Short.MAX_VALUE))
                                            .addGroup(
                                                gl_gsPanel
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        btnAdd,
                                                        GroupLayout.PREFERRED_SIZE,
                                                        35,
                                                        GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(ComponentPlacement.RELATED)))
                                    .addComponent(
                                        btnNew,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        btnRemove,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        btnEdit,
                                        GroupLayout.PREFERRED_SIZE,
                                        32,
                                        GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                scrollPane, GroupLayout.DEFAULT_SIZE, 406, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_gsPanel.setVerticalGroup(
        gl_gsPanel
            .createParallelGroup(Alignment.TRAILING)
            .addGroup(
                Alignment.LEADING,
                gl_gsPanel
                    .createSequentialGroup()
                    .addGap(3)
                    .addComponent(
                        lblThisGeneralizationParticipates,
                        GroupLayout.PREFERRED_SIZE,
                        25,
                        GroupLayout.PREFERRED_SIZE)
                    .addGap(4)
                    .addComponent(scrollPane)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(
                        gl_gsPanel
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(btnRemove)
                            .addComponent(
                                btnNew, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                btnAdd, GroupLayout.PREFERRED_SIZE, 32, GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnEdit))
                    .addContainerGap()));
    gl_gsPanel.linkSize(
        SwingConstants.VERTICAL, new Component[] {btnRemove, btnAdd, btnNew, btnEdit});
    gl_gsPanel.linkSize(
        SwingConstants.HORIZONTAL, new Component[] {btnRemove, btnAdd, btnNew, btnEdit});
    gsPanel.setLayout(gl_gsPanel);

    setLayout(groupLayout);

    setInitialData();
  }
コード例 #25
0
ファイル: ConnectionView.java プロジェクト: jcokimle/BitMusic
  @Override
  public void initPanel() {
    System.out.println("--- ConnectionView.initPanel()");

    Dimension d = new Dimension(80, 20);
    this.connectionLabel.setSize(d);
    this.loginLabel.setSize(d);
    this.passwordLabel.setSize(d);
    this.connectButton.setSize(d);
    this.resetButton.setSize(d);
    this.createUserButton.setSize(d);

    this.loginField.setColumns(10);
    this.passwordField.setColumns(10);

    this.connectButton.addActionListener(this.getController().new ConnectionListener());
    this.resetButton.addActionListener(this.getController().new ResetListener());
    this.createUserButton.addActionListener(this.getController().new CreateNewUserListener());

    GroupLayout layout = new GroupLayout(this.getPanel());
    this.getPanel().setLayout(layout);

    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);

    layout.setHorizontalGroup(
        layout
            .createSequentialGroup()
            .addComponent(connectionLabel)
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(loginLabel)
                    .addComponent(passwordLabel)
                    .addComponent(connectButton))
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(loginField)
                    .addComponent(passwordField)
                    .addComponent(resetButton))
            .addComponent(createUserButton));
    layout.setVerticalGroup(
        layout
            .createSequentialGroup()
            .addComponent(connectionLabel)
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(loginLabel)
                    .addComponent(loginField))
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(passwordLabel)
                    .addComponent(passwordField))
            .addGroup(
                layout
                    .createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(connectButton)
                    .addComponent(resetButton))
            .addComponent(createUserButton));

    layout.linkSize(SwingConstants.HORIZONTAL, loginLabel, loginField);
    layout.linkSize(SwingConstants.HORIZONTAL, passwordLabel, passwordField);
  }
コード例 #26
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    usernameLabel = new javax.swing.JLabel();
    usernameTextField = new javax.swing.JTextField();
    oldPasswordLabel = new javax.swing.JLabel();
    oldPasswordField = new javax.swing.JPasswordField();
    newPasswordLabel = new javax.swing.JLabel();
    newPasswordField = new javax.swing.JPasswordField();
    confirmPasswordLabel = new javax.swing.JLabel();
    confirmPasswordField = new javax.swing.JPasswordField();
    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    org.jdesktop.application.ResourceMap resourceMap =
        org.jdesktop.application.Application.getInstance(ke.go.moh.oec.reception.gui.App.class)
            .getContext()
            .getResourceMap(ChangePasswordDialog.class);
    setTitle(resourceMap.getString("Form.title")); // NOI18N
    setName("Form"); // NOI18N
    setResizable(false);

    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel1.setName("jPanel1"); // NOI18N

    usernameLabel.setText(resourceMap.getString("usernameLabel.text")); // NOI18N
    usernameLabel.setName("usernameLabel"); // NOI18N

    usernameTextField.setEditable(false);
    usernameTextField.setName("usernameTextField"); // NOI18N

    oldPasswordLabel.setText(resourceMap.getString("oldPasswordLabel.text")); // NOI18N
    oldPasswordLabel.setName("oldPasswordLabel"); // NOI18N

    oldPasswordField.setName("oldPasswordField"); // NOI18N

    newPasswordLabel.setText(resourceMap.getString("newPasswordLabel.text")); // NOI18N
    newPasswordLabel.setName("newPasswordLabel"); // NOI18N

    newPasswordField.setName("newPasswordField"); // NOI18N

    confirmPasswordLabel.setText(resourceMap.getString("confirmPasswordLabel.text")); // NOI18N
    confirmPasswordLabel.setName("confirmPasswordLabel"); // NOI18N

    confirmPasswordField.setName("confirmPasswordField"); // NOI18N

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(confirmPasswordLabel)
                            .addComponent(newPasswordLabel)
                            .addComponent(oldPasswordLabel)
                            .addComponent(usernameLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                usernameTextField,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                296,
                                Short.MAX_VALUE)
                            .addComponent(
                                oldPasswordField,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                296,
                                Short.MAX_VALUE)
                            .addComponent(
                                newPasswordField,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                296,
                                Short.MAX_VALUE)
                            .addComponent(
                                confirmPasswordField,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                296,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(usernameLabel)
                            .addComponent(
                                usernameTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(oldPasswordLabel)
                            .addComponent(
                                oldPasswordField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(newPasswordLabel)
                            .addComponent(
                                newPasswordField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(confirmPasswordLabel)
                            .addComponent(
                                confirmPasswordField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance(ke.go.moh.oec.reception.gui.App.class)
            .getContext()
            .getActionMap(ChangePasswordDialog.class, this);
    okButton.setAction(actionMap.get("changePasword")); // NOI18N
    okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
    okButton.setName("okButton"); // NOI18N

    cancelButton.setAction(actionMap.get("cancel")); // NOI18N
    cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
    cancelButton.setName("cancelButton"); // NOI18N

    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)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(okButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(cancelButton)))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, okButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #27
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() {

    removeLabel = new javax.swing.JLabel();
    removeTextField = new javax.swing.JTextField();
    cancelButton = new javax.swing.JButton();
    okButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setName("Form"); // NOI18N
    setResizable(false);

    removeLabel.setText(
        org.openide.util.NbBundle.getMessage(
            AddRemovedStringView.class, "AddRemovedStringView.removeLabel.text")); // NOI18N
    removeLabel.setName("removeLabel"); // NOI18N

    removeTextField.setText(
        org.openide.util.NbBundle.getMessage(
            AddRemovedStringView.class, "AddRemovedStringView.removeTextField.text")); // NOI18N
    removeTextField.setName("removeTextField"); // NOI18N
    removeTextField.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeTextFieldActionPerformed(evt);
          }
        });

    cancelButton.setText(
        org.openide.util.NbBundle.getMessage(
            AddRemovedStringView.class, "AddRemovedStringView.cancelButton.text")); // NOI18N
    cancelButton.setName("cancelButton"); // NOI18N
    cancelButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelButtonActionPerformed(evt);
          }
        });

    okButton.setText(
        org.openide.util.NbBundle.getMessage(
            AddRemovedStringView.class, "AddRemovedStringView.okButton.text")); // NOI18N
    okButton.setName("okButton"); // NOI18N
    okButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(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)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(removeLabel)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        removeTextField,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        433,
                                        Short.MAX_VALUE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(okButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(cancelButton)))
                    .addContainerGap()));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {cancelButton, okButton});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(removeLabel)
                            .addComponent(
                                removeTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #28
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() {

    jScrollPane1 = new javax.swing.JScrollPane();
    lstProduits = new javax.swing.JList();
    txtNom = new javax.swing.JTextField();
    txtPoids = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    btnModifier = new javax.swing.JButton();
    btnEnregistrer = new javax.swing.JButton();
    btnEffacer = new javax.swing.JButton();
    btnAnnuler = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JSeparator();
    btnPrevious = new javax.swing.JButton();
    btnNext = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    cbxSearch = new javax.swing.JComboBox();
    txtSearch = new javax.swing.JTextField();
    btnSearch = new javax.swing.JButton();
    jSeparator2 = new javax.swing.JSeparator();
    MaskFormatter mf = null;
    try {
      mf = new MaskFormatter("###×###×##");
      mf.setPlaceholderCharacter('_');
    } catch (ParseException p) {
      p.printStackTrace();
    }
    ftxtDimension = new javax.swing.JFormattedTextField(mf);
    txtSections = new javax.swing.JTextField();
    jLabel9 = new javax.swing.JLabel();
    lblDensité = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenu2 = new javax.swing.JMenu();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowOpened(java.awt.event.WindowEvent evt) {
            formWindowOpened(evt);
          }
        });

    lstProduits.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            lstProduitsValueChanged(evt);
          }
        });
    jScrollPane1.setViewportView(lstProduits);

    jLabel1.setFont(new java.awt.Font("Colonna MT", 3, 24)); // NOI18N
    jLabel1.setText("Blocks");

    jLabel2.setText("Nom");

    jLabel3.setText("Poids");

    jLabel4.setText("Dimension");

    jLabel5.setText("Densité");

    btnModifier.setText("Modifier");
    btnModifier.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnModifierActionPerformed(evt);
          }
        });

    btnEnregistrer.setText("Enregistrer");
    btnEnregistrer.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEnregistrerActionPerformed(evt);
          }
        });

    btnEffacer.setText("Effacer");
    btnEffacer.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEffacerActionPerformed(evt);
          }
        });

    btnAnnuler.setText("Annuler");
    btnAnnuler.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAnnulerActionPerformed(evt);
          }
        });

    btnPrevious.setText("<");

    btnNext.setText(">");

    jLabel6.setText("Rechecher");

    cbxSearch.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"Sélectionner critère", "Nom", "Densité"}));
    cbxSearch.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cbxSearchActionPerformed(evt);
          }
        });

    btnSearch.setText("Chercher");
    btnSearch.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSearchActionPerformed(evt);
          }
        });

    jLabel9.setText("Nombre de séctions");

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

    jMenu2.setText("Edit");
    jMenuBar1.add(jMenu2);

    setJMenuBar(jMenuBar1);

    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(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        107,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addGap(2, 2, 2)
                                                                    .addComponent(btnModifier)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(btnEnregistrer)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(btnEffacer)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(btnAnnuler))
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addGroup(
                                                                        layout
                                                                            .createParallelGroup(
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addComponent(jLabel2)
                                                                            .addComponent(jLabel3)
                                                                            .addComponent(jLabel4)
                                                                            .addComponent(jLabel5))
                                                                    .addGap(33, 33, 33)
                                                                    .addGroup(
                                                                        layout
                                                                            .createParallelGroup(
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .TRAILING,
                                                                                false)
                                                                            .addComponent(
                                                                                lblDensité,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .DEFAULT_SIZE,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .DEFAULT_SIZE,
                                                                                Short.MAX_VALUE)
                                                                            .addComponent(
                                                                                txtNom,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addComponent(
                                                                                txtPoids,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addComponent(
                                                                                ftxtDimension,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .DEFAULT_SIZE,
                                                                                86,
                                                                                Short.MAX_VALUE))
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addGroup(
                                                                        layout
                                                                            .createParallelGroup(
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addGroup(
                                                                                layout
                                                                                    .createSequentialGroup()
                                                                                    .addGap(
                                                                                        10, 10, 10)
                                                                                    .addComponent(
                                                                                        txtSections,
                                                                                        javax.swing
                                                                                            .GroupLayout
                                                                                            .PREFERRED_SIZE,
                                                                                        57,
                                                                                        javax.swing
                                                                                            .GroupLayout
                                                                                            .PREFERRED_SIZE))
                                                                            .addGroup(
                                                                                layout
                                                                                    .createParallelGroup(
                                                                                        javax.swing
                                                                                            .GroupLayout
                                                                                            .Alignment
                                                                                            .LEADING)
                                                                                    .addComponent(
                                                                                        jLabel9)
                                                                                    .addGroup(
                                                                                        javax.swing
                                                                                            .GroupLayout
                                                                                            .Alignment
                                                                                            .TRAILING,
                                                                                        layout
                                                                                            .createSequentialGroup()
                                                                                            .addComponent(
                                                                                                btnPrevious)
                                                                                            .addPreferredGap(
                                                                                                javax
                                                                                                    .swing
                                                                                                    .LayoutStyle
                                                                                                    .ComponentPlacement
                                                                                                    .RELATED)
                                                                                            .addComponent(
                                                                                                btnNext)
                                                                                            .addGap(
                                                                                                6,
                                                                                                6,
                                                                                                6))))))
                                                    .addGap(18, 18, 18))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGap(147, 147, 147)
                                                    .addComponent(
                                                        jLabel1,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        316,
                                                        Short.MAX_VALUE))))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel6)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        cbxSearch,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtSearch,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        127,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(btnSearch)))
                    .addContainerGap())
            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE)
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {btnAnnuler, btnEffacer, btnEnregistrer, btnModifier});

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {ftxtDimension, lblDensité, txtNom, txtPoids});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(23, 23, 23)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                txtNom,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel2)
                                            .addComponent(btnPrevious)
                                            .addComponent(btnNext))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                txtPoids,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel3))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel4)
                                            .addComponent(
                                                ftxtDimension,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel9))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel5)
                                            .addComponent(
                                                txtSections,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblDensité))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(btnModifier)
                                            .addComponent(btnEnregistrer)
                                            .addComponent(btnEffacer)
                                            .addComponent(btnAnnuler)))
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                180,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jSeparator1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        10,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(
                                cbxSearch,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtSearch,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnSearch))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jSeparator2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        10,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    layout.linkSize(
        javax.swing.SwingConstants.VERTICAL,
        new java.awt.Component[] {ftxtDimension, lblDensité, txtNom, txtPoids});

    pack();
  } // </editor-fold>//GEN-END:initComponents
コード例 #29
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() {

    jPanel2 = new javax.swing.JPanel();
    jPanel1 = new javax.swing.JPanel();
    jTPesquisarProduto = new javax.swing.JTextField();
    jButton1 = new javax.swing.JButton();
    jComboBox1 = new javax.swing.JComboBox();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTableProduto = new javax.swing.JTable();
    jButton6 = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE));

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Produtos");
    setMinimumSize(new java.awt.Dimension(750, 350));
    setResizable(false);

    jPanel1.setBackground(new java.awt.Color(204, 204, 204));
    jPanel1.setForeground(new java.awt.Color(153, 153, 153));

    jButton1.setText("Pesquisar");
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });

    jComboBox1.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"Item 1", "Item 2", "Item 3", "Item 4"}));
    jComboBox1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBox1ActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jComboBox1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        100,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jTPesquisarProduto,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        250,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jButton1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        96,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                jTPesquisarProduto,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton1)
                            .addComponent(
                                jComboBox1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    this.jComboBox1.removeAllItems();

    this.jComboBox1.addItem("Nome");
    this.jComboBox1.addItem("Código");
    this.jComboBox1.setSelectedIndex(1);

    jButton2.setText("adicionar");
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });

    jButton3.setText("Excluir");
    jButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
          }
        });

    jButton4.setText("editar");
    jButton4.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
          }
        });

    jButton5.setText("Sair");
    jButton5.setPreferredSize(new java.awt.Dimension(100, 29));
    jButton5.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
          }
        });

    jTableProduto.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null}
            },
            new String[] {"Title 1", "Title 2", "Title 3", "Title 4"}));
    jTableProduto.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
    jTableProduto.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    jTableProduto.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            jTableProdutoMouseClicked(evt);
          }

          public void mousePressed(java.awt.event.MouseEvent evt) {
            jTableProdutoMousePressed(evt);
          }
        });
    jScrollPane2.setViewportView(jTableProduto);

    jButton6.setText("Atualizar");
    jButton6.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
          }
        });

    jPanel3.setBackground(new java.awt.Color(255, 0, 0));

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 16, Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 13, Short.MAX_VALUE));

    jLabel1.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N
    jLabel1.setText("Produtos abaixo do estoque mínimo");

    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)
                            .addComponent(
                                jScrollPane2,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                729,
                                Short.MAX_VALUE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jPanel3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        jButton5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jButton2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        96,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        jButton4,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        97,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        jButton3,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        90,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jButton6)
                                    .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())
            .addComponent(
                jPanel1,
                javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

    layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {jButton2, jButton3, jButton4, jButton6});

    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton4)
                            .addComponent(jButton3)
                            .addComponent(jButton2)
                            .addComponent(jButton6))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        172,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jButton5,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(
                                jPanel3,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    pack();
    setLocationRelativeTo(null);
  } // </editor-fold>//GEN-END:initComponents
コード例 #30
0
ファイル: BorrowerPanel.java プロジェクト: fafeitsch/Loft
  /**
   * 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() {

    jScrollPane1 = new javax.swing.JScrollPane();
    borrowersTable = new javax.swing.JTable();
    jPanel1 = new javax.swing.JPanel();
    addBorrowerButton = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    deleBorrowerButton = new javax.swing.JButton();
    searchBorrowersButton = new javax.swing.JButton();
    showAllButton = new javax.swing.JButton();
    entriesLabel = new javax.swing.JLabel();
    counterLabel = new de.web.feitsch.fabian.loft.components.CounterLabel();

    BundleConverter bundle = BundleConverter.getInstance();

    setName(bundle.getString("gui.edit.borrowers")); // NOI18N

    borrowersTable.setModel(new BorrowerDataModel(reader));
    borrowersTable.setDefaultRenderer(String.class, new ToolTipRenderer());
    borrowersTable.getColumn(bundle.getString("data.id")).setCellRenderer(new DigitCellRenderer());
    borrowersTable.getColumn(bundle.getString("data.id")).setPreferredWidth(25);
    borrowersTable.getColumn(bundle.getString("data.borrower.information")).setPreferredWidth(250);
    borrowersTable.getColumn(bundle.getString("data.borrower.mail")).setPreferredWidth(100);
    borrowersTable.setName(""); // NOI18N
    borrowersTable.getTableHeader().setReorderingAllowed(false);
    jScrollPane1.setViewportView(borrowersTable);

    addBorrowerButton.setText(bundle.getString("gui.borrower.add_borrower")); // NOI18N
    addBorrowerButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addBorrowerPerformed(evt);
          }
        });
    addBorrowerButton.setMnemonic(bundle.getMnemonic("gui.borrower.add_borrower"));

    jButton1.setText(bundle.getString("gui.borrower.edit_borrower")); // NOI18N
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            editBorrowerPerformed(evt);
          }
        });
    jButton1.setMnemonic(bundle.getMnemonic("gui.borrower.edit_borrower"));

    deleBorrowerButton.setText(bundle.getString("gui.borrower.delete_borrower")); // NOI18N
    deleBorrowerButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteBorrowerPerformed(evt);
          }
        });
    deleBorrowerButton.setMnemonic(bundle.getMnemonic("gui.borrower.delete_borrower"));

    searchBorrowersButton.setText(bundle.getString("gui.borrower.search_borrower")); // NOI18N
    searchBorrowersButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchBorrowersPerformed(evt);
          }
        });
    searchBorrowersButton.setMnemonic(bundle.getMnemonic("gui.borrower.search_borrower"));

    showAllButton.setText(bundle.getString("gui.borrower.show_all")); // NOI18N
    showAllButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            showAllPerformed(evt);
          }
        });
    showAllButton.setMnemonic(bundle.getMnemonic("gui.borrower.show_all"));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(addBorrowerButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButton1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(deleBorrowerButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(searchBorrowersButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(showAllButton)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel1Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {searchBorrowersButton, showAllButton});

    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(addBorrowerButton)
                            .addComponent(jButton1)
                            .addComponent(deleBorrowerButton)
                            .addComponent(searchBorrowersButton)
                            .addComponent(showAllButton))
                    .addContainerGap()));

    entriesLabel.setText(bundle.getString("gui.tables.entries")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.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()
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        784,
                                        Short.MAX_VALUE)
                                    .addContainerGap())
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        jPanel1,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGap(13, 13, 13))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        counterLabel,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(entriesLabel)
                                    .addContainerGap()))));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(entriesLabel)
                            .addComponent(
                                counterLabel,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
  } // </editor-fold>//GEN-END:initComponents