Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 请大家帮忙!一个猜数的程序
wangyabing





发贴: 18
积分: 0
于 2006-01-01 21:13 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list

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);

}
}
}


why edited on 2006-01-01 21:49


话题树型展开
人气 标题 作者 字数 发贴时间
5916 请大家帮忙!一个猜数的程序 wangyabing 1332 2006-01-01 21:13
4460 Re:请大家帮忙!一个猜数的程序 why 748 2006-01-01 21:54
4430 Re:请大家帮忙!一个猜数的程序 ranchgirl 104 2006-01-02 02:05
4925 Re:请大家帮忙!一个猜数的程序 DeadPoet 40 2006-01-04 11:52
4652 Re:请大家帮忙!一个猜数的程序 Ginakind 7 2006-01-08 18:03
4826 Re:请大家帮忙!一个猜数的程序 Ginakind 92 2006-01-08 18:05

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   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