📄 panel.java
字号:
package one_piece;import java.awt.*;import javax.swing.JPanel;import javax.swing.*;import com.borland.jbcl.layout.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Panel extends JPanel { public static int sqlenth = 20;//方块的大小 public static int Row = 20; public static int Comln = 10; JLabel label[][] = new JLabel[Comln][Row]; XYLayout xYLayout1 = new XYLayout(); public Panel() { try { jbInit(); } catch(Exception ex) { ex.printStackTrace(); } } public void SetIcon(int row ,int comln,ImageIcon image) { ImageIcon thisimage; thisimage = image; if(comln<20) label[row][comln].setIcon(thisimage); else ; } void jbInit() throws Exception { this.setLayout(xYLayout1); for(int i = 0;i<Comln;i++) for(int j = 0;j<Row;j++) { label[i][j] = new JLabel(); this.add(label[i][j], new XYConstraints(sqlenth*i,sqlenth*j , -1, -1)); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -