文件名称:Traffic_Light交通模拟
文件大小:64KB
文件格式:RAR
更新时间:2012-06-30 17:05:08
Traffic_Light
package GUI; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; /* * 查询记录的登录窗口 * */ public class SelectGUI extends JDialog { /** * */ private static final long serialVersionUID = -5191965365261772248L; private JPanel jp; private JLabel[] jl = { new JLabel("请输入您要查询记录的时间"), new JLabel("开始时间:"), new JLabel("结束时间:") }; private JTextField jt1, jt2; private JButton jb; public SelectGUI(final JFrame jf) { jp = new JPanel(); jp.setLayout(null); jl[0].setBounds(100, 30, 200, 20); jp.add(jl[0]); jl[1].setBounds(60, 80, 80, 20); jp.add(jl[1]); jt1 = new JTextField(); jt1.setBounds(150, 80, 100, 20); jp.add(jt1); jl[2].setBounds(60, 130, 80, 20); jp.add(jl[2]); jt2 = new JTextField(); jt2.setBounds(150, 130, 100, 20); jp.add(jt2); jb = new JButton("确定"); jb.setBounds(170, 200, 60, 20); jb.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (jt1.getText() == null || jt1.getText().equals("")) { JOptionPane.showMessageDialog(jf, "您没有输入开始时间,请重新输入"); } if (jt2.getText() == null || jt2.getText().equals("")) { JOptionPane.showMessageDialog(jf, "您没有输入结束时间,请重新输入"); } else { new DatebaseGUI(jf, jt1.getText(), jt2.getText()); } } }); jp.add(jb); this.add(jp); this.setTitle("查询历史记录"); this.setResizable(false); this.setBounds(100, 100, 400, 300); this.setVisible(true); jf.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); } public static void main(String[] args) { JFrame jf = new JFrame(); new SelectGUI(jf); } }
【文件预览】:
Traffic_Light
----.project(372B)
----bin()
--------Logic()
--------sql()
--------JDBC()
--------GUI()
----src()
--------Logic()
--------sql()
--------JDBC()
--------GUI()
----.classpath(302B)