62,628
社区成员
发帖
与我相关
我的任务
分享/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package wuzi;
import java.awt.*;
/**
*
* @author Administrator
*/
public class Wuzi extends Frame{
/**
* @param args the command line arguments
*/
public static final int mm=15;
public static int n;
public int qp[][]=new int[mm][mm];
public static void main(String[] args) {
// TODO code application logic here
Wuzi myFrame=new Wuzi();
myFrame.setVisible(true);
}
public Wuzi(){
super();
final GridLayout gridLayout=new GridLayout(mm,mm);
gridLayout.setHgap(0);
gridLayout.setVgap(0);
Panel panel=new Panel();
panel.setLayout(gridLayout);
add(panel,BorderLayout.CENTER);
qz qzs[][]=new qz[mm][mm];
for(int row=0;row<mm;row++){
for(int col=0;col<mm;col++){
qzs[row][col]=new qz(row,col);
qzs[row][col].addMouseListener(new MouseListenter(){
public void mouseClicked(MouseEvent e){
qz qz1=(qz)e.getSource();
}
});
panel.add(qzs[row][col]);
}
}
}
}
class qz extends Panel{
public int i,j;
public qz(int row,int col){
}
}import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class Wuzi extends Frame {
/**
* @param args
* the command line arguments
*/
public static final int mm = 15;
public static int n;
public int qp[][] = new int[mm][mm];
public static void main(String[] args) {
// TODO code application logic here
Wuzi myFrame = new Wuzi();
myFrame.setVisible(true);
}
public Wuzi() {
super();
final GridLayout gridLayout = new GridLayout(mm, mm);
gridLayout.setHgap(0);
gridLayout.setVgap(0);
Panel panel = new Panel();
panel.setLayout(gridLayout);
add(panel, BorderLayout.CENTER);
qz qzs[][] = new qz[mm][mm];
for (int row = 0; row < mm; row++) {
for (int col = 0; col < mm; col++) {
qzs[row][col] = new qz(row, col);
qzs[row][col].addMouseListener(new MouseListener() {
public void mouseClicked(MouseEvent e) {
qz qz1 = (qz) e.getSource();
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
});
panel.add(qzs[row][col]);
}
}
}
}
class qz extends Panel {
public int i, j;
public qz(int row, int col) {
}
}