棋盘覆盖图形化界面java
case 3:
text[i][j].setBackground(Color.CYAN);
break;
case 4:
text[i][j].setBackground(Color.orange);
break;
default:
text[i][j].setBackground(Color.BLACK);
}
}}
package 棋盘覆盖;
import java.awt.Color;
import java.awt.Font;
import java.util.Random;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
public class Dmain extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel mainPane;