⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chessboard.java

📁 JAVA 写的五子棋
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import javax.swing.*;

import java.awt.geom.*;

/**
 * draw the chessboard & display the chessman
 */
public class ChessBoard extends JFrame {
	static JFrame f;
	 static Container c;
     static JLabel jlbel;
     static DrawLine a;
	public ChessBoard() {
		f = new JFrame("五子棋游戏...");
		Container c = f.getContentPane();
		c.setLayout(null);
		a = new DrawLine();

		
		

		a.setLocation(0, 0);
		a.setSize(635, 635);
		c.add(a);
		
		JMenuBar jm = new Caidan(a);
		f.setJMenuBar(jm);
		
		JLabel bp = new ButtonPanel(a);
		bp.setLocation(655,425);
		bp.setSize(210, 210);
		
		c.add(bp);
		
		JPanel p1=new Pane1();
		p1.setLocation(655,25);
		p1.setSize(210,170);
		
		c.add(p1);
		
		JPanel p2=new Pane2();
		p2.setLocation(655,220);
		p2.setSize(210,170);
		
		c.add(p2);
		
		
		
		ImageIcon icon1=new ImageIcon("back2.jpg");
      
		if(Option.icon==null){
			//icon1=Option.icon;
			//System.out.println("bu weikong");
			//Option.icon=null;
		}
		
		else {
			icon1=Option.icon;
		}
		jlbel=new JLabel(icon1);
	   jlbel.setIcon(icon1);
	
		jlbel.setLocation(0,0);
		jlbel.setSize(900,750);
		f.add(jlbel);	
	

		f.setSize(900, 750);
		f.setVisible(true);
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	}
	public static JFrame getJF(){
		return f;
	}
	//public static Container getContainer(){
	//	return c;
	//}

	public static JLabel getJL(){
		return jlbel;
		
		
	}
	
	
	public static DrawLine getDL(){
		return a;
	}


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -