1.急求猜数字小游戏代码
急求猜数字小游戏代码
本人是猜喜JAVA语言爱好者,赠送你我的欢源破解网站源码查看源码。
还是码猜北斗 c源码学学JAVA吧。
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
class Guess extends JFrame implements ActionListener{
int rand;
JLabel label = new JLabel("Enter whole number:");
JLabel label_image = new JLabel( new ImageIcon(".gif"));
JTextField textfield = new JTextField();
JButton button_guess = new JButton("Guess");
JButton button_again = new JButton("Once again");
JPanel panel_north = new JPanel();
JPanel panel_center = new JPanel();
JPanel panel_north_middle = new JPanel();
TextArea textarea = new TextArea(null,喜欢竞价手机源码,,TextArea.SCROLLBARS_BOTH);
//---------------------------------------
Guess(){
this.setSize(,);
this.rand=(int)(Math.random()*);
Container face =this.getContentPane();
face.add(panel_north,"North");
face.add(panel_center);
panel_north.setLayout(new GridLayout(1,3,3,1));
panel_north.add(label);
panel_north.add(textfield);
panel_north.add(button_guess);
panel_north.add(button_again);
panel_center.add(textarea);
panel_center.add(label_image);
button_guess.addActionListener(this);
button_again.addActionListener(this);
this.setVisible(true);
}
//---------------------------------------------
public void actionPerformed(ActionEvent w){
try{
if(w.getSource()==button_guess){
String s=textfield.getText();
int x=Integer.parseInt(s);
if(x==rand){
textarea.append("Congratulate!\n");
}
else if(x>rand){
textarea.append("The number on the height side!\n");
}
else if(x<rand){
textarea.append("The number on the low side!\n");
}
textfield.setText("");
textfield.requestFocusInWindow();
}
else if(w.getSource()==button_again){
textarea.setText("");
rand=(int)(Math.random()*);
}
}catch(Exception e){ }
}
//-----------------------------------------------------------
public static void main(String arg[]){
new Guess().setDefaultLookAndFeelDecorated(true);
}
}
2025-02-06 16:581958人浏览
2025-02-06 16:572662人浏览
2025-02-06 16:431967人浏览
2025-02-06 16:402678人浏览
2025-02-06 16:252593人浏览
2025-02-06 16:212986人浏览
2024年6月22日晚,荆门市公安局高新区·掇刀区分局的警察在执行公务。一年前,该局对一犯罪嫌疑人执行指居期间,嫌疑人死亡。图片来源:掇刀融媒)一起连环盗窃案的嫌疑人,在被执行“指居”第十日后死亡。经
1.问道盗取源代码做问道SF!!让GY亏死!2.无忧招聘系统的人才市场源程序源代码怎么样?3.php源码有哪些4.精选70套微信小程序源码、小游戏源码!问道盗取源代码做问道SF!!让GY亏死! 容
1.分享七个PHP源码的网站2.求专家解答 Powerful JuteForum phpwind v8.0 Discuz! X1.5 这三款论坛怎么样,哪款好一点3.求一PHP论坛源码,请看问题补充。