如何用java小程序做一个列表程序

求高手解决一下,用java做一个下面的程序_百度知道
求高手解决一下,用java做一个下面的程序
baidu://g.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><a href="http.baidu.jpg" esrc="http://g
提问者采纳
&&&&&//&&&nbsp.CENTER).append(str1 + "\n");&&}&&JPanel hp = new JPanel(new BorderLayout());&&&&&&&nbsp, 550;String s = new String("大了;&&&&&&nbsp.awt.setText("");&} else {&&&&&&&//&&&&&&&&nbsp.VERTICAL);&nbsp你可以自己看着修改下;&&&&&String str =&&&&&&&&&&&&String s = new String("小了;&&&&&nbsp.add(quit);&&&&&&&&&&&&&i--;&&&&&&&JMenuBar menu = new JMenuBar();&&&&nbsp,repeat 按钮将加入此面板&nbsp.setBounds(400;&&&nbsp.add(&&&&&&&&nbsp.setJMenuBar(menu);&nbsp.append(s);&class MyWindowMonitor extends WindowAdapter { // X 监听器&&&nbsp.WEST);& n) {&&&&&&&String s = new String("小了;&&&&&&S&&&&&&&&&&&&&&&&&public int n1;&&&&&&&&} else if (n1 &&&&&&&&&&&n = new Random();&&&&&&} else if (n1 &&nbsp,&&&&&&&&&&&nbsp:\n您有10次猜数字的机会;&&&&&& // answer 按钮&&&&&&nbsp.setResizable(false);&&&&a;&&&&&&nbsp.add(he);&&&&&&&&&&&&&&nbsp, BorderL // answer 按钮区&&&&&&&&&&&&&if (i == 0) {&&&&&&&&n1 = I&&&&&&&&&&&&&&&&nbsp.setLineWrap(true);&&&&&&&&nbsp.append("还要继续;a;& // 输入框&&nbsp:" + n);&&&&&&&&&nbsp,15));&&&&&&&&&&&&&&a;&nbsp。\n点击“答案”按钮可以显示答案;&&nbsp.setTitle("帮助"),请点击“重玩”按钮.add(about);& // 菜单项&&&&&&&&&&&&nbsp.RIGHT);&&&&jd.");&&&&&&&&i = 9;&&&&&&&&&&&&}&&&nbsp.&&&&&&& 100 || n1 &&&&&+ "或点击确认按钮;& // 菜单项&&&&nbsp, 15));&&nbsp!请重 新输入吧;&&&&&&&&&&&&nbsp, BorderL&JLabel help = new JLabel("请输入100~1000之间的数字;&nbsp!\n");&&&&nbsp! 你还有" + i + "次机会;&&&&nbsp!\n还要继续;&& // 菜单栏&&&&&&&&&&&&&&&&&&&&&&&&& // 记录剩余的猜数字次数&&&&&&&&&&&&&&&&&&&nbsp.addActionListener(new MyMonitor3());& // 提示文本显示区域&nbsp.setBounds(450;&&&&&&&&&&&&&&&&&&a;&&&&&&&&class MyMonitor implements ActionListener { // 确定按钮监听器&&&&&&&&&&&&&&&&&&&&&else if (n1 == n) {&&&&&&&&&&&&&&&&&&&&&}&&&&&&&&&nbsp.append("还要继续;&&a;&&nbsp!\n");&&&&&nbsp.WEST);a;&&nbsp.addActionListener(new MyMonitor());&&&&&&&&&&&&nbsp.&&&&&&&&&&&&& // 输入文本框所在行面板;&&&&nbsp:");&&&nbsp.getText();&&&&&&&&&&&&&&&&&JTextArea jta = new JTextArea();&&&&&&&&&&&&&&if (n1 &&&&&&JPanel p = new JPanel(new BorderLayout());&&&&&&&&&&&a!\n"&&&nbsp.addActionListener(new MyMonitor4());&&&&&&& // 输入框将加入此面板;&&&&nbsp.add(&&&&&&&&&&&&&&&&a;&nbsp.*;&String str1 = new String("正确答案是.EAST);&&&buttonsAi--;if (i == 0) {&&public void actionPerformed(ActionEvent ex2) {&nbsp.add(f);&}& n) {&&&&&&&&&&&&nbsp, F&&nbsp!\n");&&JPanel buttonsArea = new JPanel(new GridLayout(1;&&&&&&&&&&& 1000) {&class gameFrame extends JFrame {&&&&&&&&&&i--;public void actionPerformed(ActionEvent ex1) {&&&&class MyMonitor3 implements ActionListener { // answer 按钮监听器&&&&&&nbsp.append(s);&&i--;&nbsp.setWrapStyleWord(true);&&&nbsp.CENTER);&&nbsp.setFont(new Font("font2";&&int n = new Random();&&&&&&&nbsp.exit(0);&class MyMonitor2 implements ActionListener { // repeat 重玩按钮监听器&&&&&&&&&&&&&&&&&nbsp.setFont(new Font("font1";&&&if (i == -1) {&&&&&&&&&&&&nbsp.addWindowListener(new MyWindowMonitor());&nbsp.setEditable(false);gameFrame() { // 构造方法&&&&&&nbsp.BOLD;&&//&&&&&&&&&&&nbsp.addActionListener(new MyMonitor1());&&&&&&&&JTextArea a = new JTextArea();&nbsp, 15));&&&&&&&&&&nbsp.*;&&&&&&nbsp,但由此游戏带来的一切后果;JMenuItem about = new JMenuItem("关于;&nbsp.setLineWrap(true);&&&&&&&&&&&&nbsp:&&&&&&&&&&&&&&&& // 文本域面板&&&a.add(re);&&&&&&&&&&&&&&&&&&public void actionPerformed(ActionEvent ex) {&&&&&&&&&&&&&&&&&&&nbsp!你还有" + i + "次机会;&&&nbsp.add(hp);&&&&&&&&&&&}&&&&&&& // 重玩按钮区;&&&&&&&&&&&&try {&nbsp.nextInt(900) + 100;&&&&&&&&&nbsp.append(s);&&&nbsp.append(s);&&nbsp, BorderL&&&&&&&&&&nbsp.add(&&&&&}&&&&&&&&&&&&&&&&&&&&&&&nbsp!\n");&&&&&&&+ "由玩家自负;&&&nbsp,请点击“重玩”按钮;&&&&&&&&&&&&&&input!很遗憾你没能猜对;&&this.;&&&&&//&&&& // 按键区(答案;&&nbsp!\n");&&&&&&&&&}&&&&&&&&nbsp!很遗憾你没能猜对;&&&JPanel tfin = new JPanel(new BorderLayout());&&&&}&&&&&public static void main(String args[]) {&&&&&nbsp.CENTER);&&&&&}&&&&&&&&&&nbsp.BOLD;&nbsp.parseInt(str);&&&&&&&&&nbsp, BorderL&&&}&&&&&&&&&&nbsp.add(jta);&&&&&&&&&nbsp, BorderL&nbsp.nextInt(900) + 100;&&nbsp.setText(""); // 确定输入按钮&nbsp!\n");&&nbsp.add(new JLabel(" ");&&&&&&JMenu f = new JMenu("文件");&&&buttonsA&&&&&&&&&&&&&nbsp.addActionListener(new MyMonitor());&&&p.add(new JScrollPane(a)).add(p;&&&&&&gameFrame g = new gameFrame();&&&&&&&&nbsp.;&nbsp!\n");&&&&&&&&&&&nbsp!\n");&} else {&&&&&&&&n1 = -1;&&&&nbsp.addActionListener(new MyMonitor2());&&&JPanel re = new JPanel(new BorderLayout());&&&&&&&&}&&&&&&&&&// 按钮将加入此面板;}&}}public class Game {&&&&&&&此面板将加入 in 面板&&&&&&&nbsp,每次你可以输入100~1000之间的任意数值;&}&&&&&JButton ensure = new JButton("确定");&&public void windowClosing(WindowEvent e) {&JMenu he = new JMenu("帮助"), BorderL&&&&nbsp,你可以玩此游戏;&&&&&&&&&&&&&&&&&&&&&&nbsp.setTitle("来;&&// in 面板&&nbsp.add(a;&nbsp,请点击“重玩”按钮;&a;&nbsp, F&&&&a;&nbsp.setAlignment(Label,此面板将加入&&&&&&&&&&&nbsp.setText("此游戏版权归singsong所有;&&&&&&&&&&&&&&&nbsp.&&&&&&&&&&& // 菜单选项&&&nbsp.add(a);&&&&&&&&&&&&&&&&&nbsp!");&&&&nbsp, BorderL&&&&&f;&&nbsp.CENTER);&JTextField input = new JTextField();&&&i = -1;&&&&nbsp.setFont(new Font("font1";&&nbsp.add(new JLabel(" ");&nbsp, 450;&&&&& // 输入框前面的提示文本&&&&&&&nbsp,按ENTER"&&&nbsp,可以点击“重玩”按钮进入新一轮游戏;&&}&&&&&&&nbsp.setText("");&nbsp.TRUETYPE_FONT;&&&&&&&&&}&&&&&&&&&&&&&&class MyMonitor4 implements ActionListener { // 关于菜单项监听器&&&&&nbsp.setResizable(false);&&&&&&&&nbsp.add(an);&&nbsp, 300);&&JPanel in = new JPanel(new GridLayout(1;&&&&&&&&&&&&&&&&&&&&nbsp,确认输入;&&nbsp, 4));&&&&&&&a;&&&&&&S&&&&nbsp, BorderLayout, BorderL&setVisible(false);&&&&&&&nbsp,tfin, 450);&&&}&&&&&&&nbsp,请点击“重玩”按钮;&&&class MyMonitor1 implements ActionListener { // quit 退出菜单项监听器&&&&nbsp,F&nbsp.CENTER);&&&&&nbsp,buttonArea将加入此面板&&&&&&&&}&&&&&&&&&nbsp。\n游戏规则;&&&&&&&&&&&&nbsp.append("恭喜你猜对了,"&&&&&&&&&&&} catch (NumberFormatException e1) {&&&&&&&JPanel an = new JPanel(new BorderLayout());&a;&nbsp.setVisible(true);&&&& // 标签 help 将加入此面板;&&&&&&&&&&&&&&&&&&&&nbsp。\n一轮游戏结束后;&&此面板将加入 in 面板&&&&&&&&&&&&+ "祝您游戏愉快;&&&&&&&&&&&&&&nbsp.add(buttonsArea);&&&&&&&nbsp.setEditable(false);&&&&&&&&&&&&&&&&&&JMenuItem quit = new JMenuItem("退出");&&&nbsp, 200;&&&&&&&&&&&&&&&&&&&&&&&&&&&&nbsp.append("无效输入;&&&&&&&&&&nbsp,我们猜数字吧, 2));&&&&&&&public void actionPerformed(ActionEvent e) {&&&&&&&&a;&&&&int i = 9;&&&&&&&& // 菜单选项&&&&&&&&&nbsp.add(tfin);&&setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);&&nbsp.NORTH);&&&&nbsp,“确定”&&&nbsp.setVisible(true);&&&&&&else {&&&&&&&&&&&&&&&&&&&&&&nbsp.*;&&&&&&&&&&&nbsp, 300;&&&&nbsp.exit(0);&&&&&&&&&&&JButton repeat = new JButton("重玩");&&&&&&&& // 重玩按钮&&import javax,重玩);&&&&&&&&&&&&&}&&&&&&&&&&&nbsp.add(&&&&&&&&&&&&&&&&&&nbsp.setWrapStyleWord(true);&&public void actionPerformed(ActionEvent ex3) {&&&&&&&nbsp.&nbsp.append(str + "\n");&&&&nbsp.setOrientation(JScrollB&&&&&&&&JButton answer = new JButton("答案");&nbsp.add(&&&&nbsp!");&&&&nbsp!\n还要继续;&String s = new String("大了;&&&&&&&&&&&&&&&&&&&&JDialog jd = new JDialog();}&nbsp.*
提问者评价
虽然和我预期的不是一样,但是基本的功能还是有,谢谢!
来自团队:
其他类似问题
35人觉得有用
为您推荐:
其他3条回答
没用过java写这玩意?我做java两年了用java的awt,这东西也就js写写玩玩
写得不错了,加油!颜色、字体可以适当调整一下。
这是VB做的,我要java做的
差不多嘛,只不过组件名称换了、事件触发的方法换了,一些语法不同了。逻辑还是相似的。
这么简单的程序还是自己学着做吧
这是VB做的,我要java做的
不管用什么语言做都很简单。一个超级简单的界面加一个超级简单的逻辑。。。随便找本java书都能找到示例。而且你如果是在学习java的话,最好自己动手去做一下,最最基本的东西都不愿意亲手做的话你修的java课程很可能不及格哟~
最基本的老师都没有教我们,那读书还有什么意思
您可能关注的推广
java的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如何成为一个合格的Java程序员_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
如何成为一个合格的Java程序员
上传于||暂无简介
阅读已结束,如果下载本文需要使用2下载券
想免费下载本文?
你可能喜欢如何成为一个好的Java程序员_土豆_高清视频在线观看一个使用eclipse编写java程序代码的简单问题?_百度知道
一个使用eclipse编写java程序代码的简单问题?
一个使用eclipse编写java程序代码的应用程序必须有main方法作为入口:以hello world为例来说明:public class HelloWorld{
public static void main(String args[])
&#47;&#47;向屏幕上写字符串&HelloWorld!&
System.out.println(&HelloWorld!&);
其他类似问题
为您推荐:
提问者采纳
}main写错了.println(&;
public static void main(String[] args){
S + say).你好java&quotpublic class HelloJava {
private static String say=&quot
提问者评价
java程序的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如何用java做一个列表程序_百度知道
如何用java做一个列表程序
注册时间:用户名、密码列表中有三个字段
可以对字段中的信息作修改,而且可以保存
这提问题没素质阿.labelLogin = new JLabel(&quot.panelLogin, gbc);列表程序&quot, gbc).gridwidth = 1.gridwidth = 2,20));
this.gridwidth = 2;
this.textFieldName = new JTextField(20);
this.getContentPane().gridy = 0,我写了代码.panelL
gbc, gbc):&quot.add(this.add(this.gridy = 1, gbc);).gridx = 1.addActionListener(this), gbc).PLAIN.gridx = 1;
.anchor = GridBagC
gbc.panelL
this.panelL
).passwordFieldPwd.buttonOk).buttonOk = new JButton(&quot.panelLogin);
this.labelTitle = new JLabel(&quot.passwordFieldP
gbc.textFieldName.panelL
用户名;登陆&quot.gridy = 2.labelTitle.panelLogin.labelPwd = new JLabel(&重置&
gbc.gridx = 0.gridx = 0;
gbc,你会运行吗;
gbc.gridy = 3;
JPanel btnPanel = new JPanel();
gbc, gbc).gridy = 1;
btnPanel.gridwidth = 2;
this.add(this:&quot:&quot.setTitle(&
gbc.WHITE)? /
gbc.buttonReset);
private void creatLoginFrame() {
Container contentPane = this.labelTitle.buttonR
this.labelName = new JLabel(&quot.gridwidth = 2.gridx = 1.panelL
this, gbc);
this.add(btnP
this.add(this.gridx = 1.setOpaque(false).labelName.add(
gbc.add(this.setFont(new Font(&quot.add(密码,Font.gridy = 3;
this.gridwidth = 1.add(this.gridx = 1.gridwidth = 2.labelT
gbc.buttonReset = new JButton(&).gridx = 0.addActionListener(this).buttonOk.setLayout(new GridBagLayout());
注册时间.panelL
gbc.panelLogin = new WelcomePanel().passwordFieldPwd = new JPasswordField(20).EAST;
gbc.gridy = 2;
this.gridy = 3, gbc).add(this.labelL
contentPane.labelPwd.passwordFieldPwd = new JPasswordField(20);
).panelLogin.gridwidth = 1;
程序title&);
GridBagConstraints gbc = new GridBagConstraints().setForeground(C
* 绘制界面方法
其他类似问题
为您推荐:
您可能关注的推广
java的相关知识
其他1条回答
用cardlayout,弄点button
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 java小程序 的文章

 

随机推荐