Esempio n. 1
0
  private void init() {
    this.setSize(frameWidth, frameHeight);
    this.setLayout(null);
    this.setOpaque(false);

    infoPanel = new JPanel();
    infoPanel.setLayout(new BorderLayout());

    userNameLabel = new JLabel();
    userNameLabel.setBounds(200, 127, 200, 20);
    userNameLabel.setFont(P.INSTANCE.getLabelFont());
    this.add(userNameLabel);

    firstNameLabel = new JLabel();
    firstNameLabel.setBounds(200, 177, 200, 20);
    firstNameLabel.setFont(P.INSTANCE.getLabelFont());
    this.add(firstNameLabel);

    lastNameLabel = new JLabel();
    lastNameLabel.setBounds(200, 227, 200, 20);
    lastNameLabel.setFont(P.INSTANCE.getLabelFont());
    this.add(lastNameLabel);

    balanceLabel = new JLabel();
    balanceLabel.setBounds(200, 277, 200, 20);
    balanceLabel.setFont(P.INSTANCE.getLabelFont());
    this.add(balanceLabel);

    addToBalance = new JLabel(("Add to balance:"));
    addToBalance.setBounds(200, 327, 130, 20);
    addToBalance.setFont(P.INSTANCE.getBoldLabelFont());
    this.add(addToBalance);

    balanceField = new JTextField();
    balanceField.setBounds(370, 327, 100, 20);
    balanceField.setFont(P.INSTANCE.getLabelFont());
    this.add(balanceField);

    passwordLabel = new JLabel("Input password:"******"Tahoma", Font.PLAIN, 12));
    error2Label.setForeground(Color.red);
    this.add(error2Label);

    error1Label = new JLabel();
    error1Label.setBounds(480, 327, 200, 20);
    error1Label.setFont(new Font("Tahoma", Font.PLAIN, 12));
    error1Label.setForeground(Color.red);
    this.add(error1Label);

    backButton = new JButton("Back");
    backButton.setFont(P.INSTANCE.getLabelFont());
    backButton.setBounds(
        margin, frameHeight - buttonHeight - 2 * margin, buttonWidth, buttonHeight);
    backButton.addActionListener(this);
    this.add(backButton);

    saveButton = new JButton("Save information");
    saveButton.setBounds(
        frameWidth - buttonWidth - margin,
        frameHeight - buttonHeight - 2 * margin,
        buttonWidth,
        buttonHeight);
    saveButton.setFont(P.INSTANCE.getLabelFont());
    saveButton.addActionListener(this);
    this.add(saveButton);
  }