Package com.jpokemon.savefilegenerator

Source Code of com.jpokemon.savefilegenerator.PlayerEditorPanel

package com.jpokemon.savefilegenerator;

import java.awt.Dimension;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.jpokemon.savefilegenerator.input.SetBadgeHandler;
import com.jpokemon.savefilegenerator.input.SetCashHandler;
import com.jpokemon.savefilegenerator.input.SetNameHandler;

public class PlayerEditorPanel extends JPanel {
  public PlayerEditorPanel(SaveGeneratorWindow sgw) {
    super();

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    setPreferredSize(new Dimension(200, 300));

    JPanel namePanel = new JPanel();
    namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.X_AXIS));
    namePanel.add(new JLabel("Username"));
    JTextField nameField = new JTextField();
    nameField.setMinimumSize(new Dimension(100, 16));
    nameField.setMaximumSize(new Dimension(100, 16));
    nameField.getDocument().addDocumentListener(new SetNameHandler(sgw, nameField));
    namePanel.add(nameField);
    add(namePanel);

    JPanel cashPanel = new JPanel();
    cashPanel.setLayout(new BoxLayout(cashPanel, BoxLayout.X_AXIS));
    cashPanel.add(new JLabel("Cash"));

    JTextField cashField = new JTextField();
    cashField.setMinimumSize(new Dimension(100, 16));
    cashField.setMaximumSize(new Dimension(100, 16));
    cashField.getDocument().addDocumentListener(new SetCashHandler(sgw, cashField));
    cashPanel.add(cashField);
    add(cashPanel);

    JPanel badgePanel = new JPanel();
    badgePanel.setLayout(new BoxLayout(badgePanel, BoxLayout.X_AXIS));
    badgePanel.add(new JLabel("Badges"));

    JTextField badgeField = new JTextField();
    badgeField.setMinimumSize(new Dimension(100, 16));
    badgeField.setMaximumSize(new Dimension(100, 16));
    badgeField.getDocument().addDocumentListener(new SetBadgeHandler(sgw, badgeField));
    badgePanel.add(badgeField);
    add(badgePanel);
  }

  public static final long serialVersionUID = 1L;
}
TOP

Related Classes of com.jpokemon.savefilegenerator.PlayerEditorPanel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.