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

您没有登录

» Java开发网 » Java GUI 设计  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 高手帮我看看代码(点fields或buttons时按纽看不见)
yezongbo





发贴: 8
积分: 0
于 2005-09-24 21:07 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 javax.swing.*;
import java.awt.event.*;

public class clientPane extends JFrame implements ActionListener
{    private Container container;
    private JLabel label1,label2;
    private JTextField field1,field2;
    private JButton button1,button2,button3;
    private JPanel panel;
  public clientPane()
  {   setBounds(300,200,450,450);
  label1=new JLabel("客户姓名:");
  label2=new JLabel("密 码");
  field1=new JTextField();
  field2=new JTextField();
  button1=new JButton(" 确定");
  button2=new JButton("取消");
  button3=new JButton("新用户注册");
  label1.setBounds(80,80,80,30);
  label2.setBounds(80,120,80,20);
  field1.setBounds(160,80,80,20);
  field2.setBounds(160,120,80,30);
  button1.setBounds(90,160,80,30);
  button2.setBounds(200,160,80,30);
  button3.setBounds(250,80,100,50);
  Container container=this.getContentPane();
  container.add(label1);
  container.add(label2);
  container.add(field1);
  container.add(field2);
  container.add(button1);
  container.add(button2);
  container.add(button3);
  button1.addActionListener(this);
  button2.addActionListener(this);
  button3.addActionListener(this);
  
  /*container.setLayout(new BorderLayout());
  panel=new JPanel();
  panel.setLayout(new GridLayout(3,2));
  panel.add(label1);
  panel.add(field1);
  panel.add(label2);
    panel.add(field2);
  panel.add(button1);
  panel.add(button2);
  container.add(panel,BorderLayout.CENTER);
  container.add(button3,BorderLayout.SOUTH);*/
  
  show();
    
    }
    
    
    public void Actionpeerformed(ActionEvent e)
    {
      }
    public static void main(String[] args)
{ clientPane application=new clientPane();
  application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
  }  
  
  
  
  }
为什么当我点里面的fields或者buttons时里面的安纽看不见了
并且界面发生了很多的变化
为什么?


why edited on 2005-09-26 17:18


话题树型展开
人气 标题 作者 字数 发贴时间
3852 高手帮我看看代码(点fields或buttons时按纽看不见) yezongbo 2827 2005-09-24 21:07
2992 Re:高手帮我看看代码 q_yuan 56 2005-09-26 16:43
3169 Re:高手帮我看看代码 q_yuan 26 2005-09-26 16:46

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