运用BorderLayout编写一个简单小游戏程序。EAST CENTER NORTH

package day14;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class RoleSelector extends JFrame{
    /** 角×××片标签 **/
    private JLabel lbRoleImage;
    /** 角色属性值 **/
    private JLabel[] lbValue;
    private String[][] strArr = {
            {"100","100","100","100","100"},
            {"200","200","200","200","200"},
            {"300","300","300","300","300"},
            {"400","400","400","400","400"},
            {"500","500","500","500","500"}
    };
    public RoleSelector(){
        JPanel pnBasic = new JPanel();
        pnBasic.setLayout(new BorderLayout());
        // 角色选择区
        String[] strArrRoleName = {"Goddess","Assassin","Death","Garuda","Captain"};
        JComboBox cbRoleName = new JComboBox(strArrRoleName);
        cbRoleName.addActionListener(new SelectMonitor());
        pnBasic.add(cbRoleName,BorderLayout.NORTH);
        // 角×××片区
        lbRoleImage = new JLabel();
        ImageIcon icon = new ImageIcon("assets/role/Goddess.png");
        lbRoleImage.setIcon(icon);
        pnBasic.add(lbRoleImage,BorderLayout.CENTER);
        // 角色属性区:
        JPanel pnRoleAttr = new JPanel();
        pnRoleAttr.setLayout(new GridLayout(5,2,5,5));
              
        String[] strTitle = {"HP:","MP:","AP:","DP:","EXP:"};
        JLabel[] lbTitle = new JLabel[5];
        lbValue = new JLabel[5];
        for(int i=0;i 
  

图形化界面处理_第1张图片