一些基础的关于java jdbc的程序代码
private JButton getBtnQuery() {
if (btnQuery == null) {
btnQuery = new JButton();
btnQuery.setBounds(new Rectangle(484, 152, 71, 30));
btnQuery.addActionListener(this);
btnQuery.setText("查找");
}
return btnQuery;
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
CountryInfoGui application = new CountryInfoGui();
application.getJFrame().setVisible(true);
}
});
}
private JFrame getJFrame() {
if (jFrame == null) {
jFrame = new JFrame();
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.setBounds(new Rectangle(450, 250, 610, 454));
jFrame.setContentPane(getJContentPane());
jFrame.setTitle("国家信息管理");
}
return jFrame;
}
private JPanel getJContentPane() {
if (jContentPane == null) {
lblGdp = new JLabel();
lblGdp.setBounds(new Rectangle(15, 106, 63, 27));
lblGdp.setText("国家GDP");
lblPopu = new JLabel();
lblPopu.setBounds(new Rectangle(285, 61, 63, 27));
lblPopu.setText("人口数量");
lblArea = new JLabel();
lblArea.setBounds(new Rectangle(15, 61, 63, 27));
lblArea.setText("国家面积");
lblRegion = new JLabel();
lblRegion.setBounds(new Rectangle(285, 17, 63, 27));