Topic: 请大家帮忙!一个猜数的程序

  Print this page

1.请大家帮忙!一个猜数的程序 Copy to clipboard
Posted by: wangyabing
Posted on: 2006-01-01 21:13


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class gussFieldTest
{
public static void main(String[] args)
{
KeyFrame frame = new KeyFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
class KeyFrame extends JFrame
{
public KeyFrame()
{
setTitle("gussFieldTest ");
setSize(WIDTH, HEIGHT);

// 将panel加入到frame
KeyPanel panel = new KeyPanel();
Container contentPane = getContentPane();
contentPane.add(panel);
}

public static final int WIDTH = 300;
public static final int HEIGHT = 200;
}
class KeyPanel extends JPanel implements ActionListener
{
public KeyPanel()
{
//注册监听器
addKeyListener(this);
}

public void init()
{
contentPane.setLayout(new FlowLayout());
setBackground(new Color(105,105,105));
Jable lb1=new Jlable("请输入你想输入的数据:",Jlable,CENTTER);
contentPane.add(lb1);
JLable lb2=new Jlable("输出结果为:",Jlable,CENTTER);
contentPane.add(lb2);
JTextField gussText1=new JTextField(10);
contentPane.add(gussText1);
JTextField gussText2=new JTextField(10);
contentPane.add(gussText2);
}
public void actionPerformde(ActionEvent e)
{
String str;
str=gussText1.getText();
if(str=gussstae)
{
gussText2.setText(str);

}
}
}

2.Re:请大家帮忙!一个猜数的程序 [Re: wangyabing] Copy to clipboard
Posted by: why
Posted on: 2006-01-01 21:54

请尽量使用准确的文字描述作为标题

Please use [code ] tag and check "Disable Smileys" when posting source code.

原來的标题:
真的是太菜了请大家帮忙呀!一个猜数的程序

 
Please tell us what your question is.
We don't want to guess -- btw, please use proper class name: it is "Guess", not "guss"
GuessFieldTest

Please double-check your source code first.
Look...
Jable lb1=new Jlable("请输入你想输入的数据:",Jlable,CENTTER);
contentPane.add(lb1);
JLable lb2=new Jlable("输出结果为:",Jlable,CENTTER);
簡直恐怖!

No one will dare to help if you continue to dump garbage like this.
假如閣下也不尊重自己的提問,自然無人願意費神.
那麼,敝人會把帖子删除--這是最後一次警告.

3.Re:请大家帮忙!一个猜数的程序 [Re: wangyabing] Copy to clipboard
Posted by: ranchgirl
Posted on: 2006-01-02 02:05

Do you even have a question??? If you don't have a question, how could somebody come out an answer??? Angry

4.Re:请大家帮忙!一个猜数的程序 [Re: wangyabing] Copy to clipboard
Posted by: DeadPoet
Posted on: 2006-01-04 11:52

这是什么烂代码啊,自己先检查了再贴出来啊,不要只管丢给别人,自己都不负责任好不好

5.Re:请大家帮忙!一个猜数的程序 [Re: wangyabing] Copy to clipboard
Posted by: Ginakind
Posted on: 2006-01-08 18:03

Question晕!!!

6.Re:请大家帮忙!一个猜数的程序 [Re: wangyabing] Copy to clipboard
Posted by: Ginakind
Posted on: 2006-01-08 18:05

Jable lb1=new Jlable("请输入你想输入的数据:",Jlable,CENTTER);

连拼写都错,请注意了。
程序的调试很重要,但是写的时候也要自己检查清楚


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923