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

您没有登录

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

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





发贴: 24
积分: 0
于 2004-08-16 10:08 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.sql.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class QueryDB
{
public static void main(String[] args)
{
QueryFrame myframe=new QueryFrame();
myframe.show();
}
}

class QueryFrame extends JFrame implements ActionListener
{
private Connection con=null;
private Statement stmt=null;
private ResultSet rs=null;
private JLabel conditionlabel=new JLabel("请填写下列查询条件",SwingConstants.CENTER);
private JLabel numberlabel=new JLabel("学号",SwingConstants.RIGHT);
private JTextField number=new JTextField(10);
private JLabel namelabel=new JLabel("姓名",SwingConstants.RIGHT);
private JTextField name=new JTextField(10);
private JLabel sexlabel=new JLabel("性别",SwingConstants.RIGHT);
private JTextField sex=new JTextField(3);
private JLabel agelabel=new JLabel("年龄",SwingConstants.RIGHT);
private JTextField age=new JTextField(3);
private JLabel deptlabel=new JLabel("所在系",SwingConstants.RIGHT);
private JTextField dept=new JTextField(4);
private JButton commit=new JButton("递交");
private JLabel resultlabel=new JLabel("查询结果",SwingConstants.CENTER);
private JTextArea resultarea=new JTextArea(10,28);
private String command=null;

public QueryFrame()
{
setTitle("数据库查询");
setSize(500,300);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}

Container c=getContentPane();
c.setLayout(new GridBagLayout());
//以下的代码功能是使用GridBagLayout布局编排Swing组件
GridBagConstraints gbc=new GridBagConstraints();
gbc.fll=GridBagConstraints.NONE;
gbc.anchor=GridBagConstraints.CENTER;
gbc.weightx=100;
gbc.weighty=100;
add(conditionlabel,gbc,3,0,5,1);

public void actionPerformed(ActionEvent evt)
{

}
}


haoyue edited on 2004-08-16 13:14


话题树型展开
人气 标题 作者 字数 发贴时间
3784 请大家帮忙看看这个程序错在哪 haoyue 2014 2004-08-16 10:08
3158 Re:请大家帮忙看看这个程序错在哪 coolnight 56 2004-08-16 17:53
3059 Re:请大家帮忙看看这个程序错在哪 haoyue 15 2004-08-17 09:41
3727 Re:请大家帮忙看看这个程序错在哪 xhxasdf 16 2004-08-18 00:13

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