别踩白块源代码java js别踩白块( 二 )


根据以下的设计要求编写源代码 。javaclass Student{
private String name;
private int age;
public Student(){
this.name = "nobody";
this.age =20;
}
public void setName(String name){
this.name = name;
}
public String getName(){
return name;
}
public void setAge(int age){
this.age = age;
}
public int getAge(){
return age;
}
public boolean isSameAge(Student s){
return age == s.age;
}
}
【急】有没有朋友用java写过别踩白块,急求源码!package 别踩白块;
import java.awt.GridLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
【别踩白块源代码java js别踩白块】
import javax.swing.JFrame;
public class Main extends JFrame implements MouseListener {
Block[] block=new Block[9];
Block1 block1=new Block1();
public Main(){
setTitle("别踩白块");
setBounds(200,300,200,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new GridLayout(3,3,5,5));
addblock();
bk();
this.setVisible(true);
}
public void addblock(){
for(int i=0;i9;i++)
{
block[i]=new Block();
add(block[i]);
}
}
public void bk(){
block1.setbk1(block[(int)(Math.random()*2)]);
block1.setbk1(block[(int)(Math.random()*2+4)]);
block1.setbk1(block[(int)(Math.random()*2+6)]);
}
public void over(){
block[3].setText("g");
block[4].setText("g");
block[5].setText("!");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Main();
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
if(e.getSource().equals(""));
over();
}
@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
}
}
别踩白块源代码java的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于js别踩白块、别踩白块源代码java的信息别忘了在本站进行查找喔 。

推荐阅读