Page 887 - 3-2
P. 887

*  생성자: Place()
             *  메소드: Place():  데이터베이스의 정보를 띄울 창을 생성
             *  데이터베이스에서 값을 읽어온 뒤 새로운 윈도우 창을 띄워서 표시해주는 클래스
             */


            import java.awt.BorderLayout;
            import java.awt.Color;
            import java.awt.EventQueue;
            import javax.swing.JFrame;
            import javax.swing.JPanel;
            import javax.swing.border.EmptyBorder;
            import javax.swing.JTextField;
            import java.awt.FlowLayout;
            import javax.swing.JCheckBox;
            import javax.swing.SwingConstants;
            import javax.swing.JButton;
            import java.awt.event.ActionListener;
            import java.sql.Connection;
            import java.sql.DriverManager;
            import java.sql.ResultSet;
            import java.sql.SQLException;
            import java.sql.Statement;
            import java.util.Timer;
            import java.util.TimerTask;
            import java.awt.event.ActionEvent;


            public class Place extends JFrame {
                    static int n;


                    static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
            static final String DB_URL =
                                 "jdbc:mysql://localhost:3306/and1?autoReconnect=true&useSSL=false";


            static final String USERNAME = "root";
            static final String PASSWORD = "raspberry";


            static JFrame jframe = new JFrame("Place");
            static private JPanel contentPane;
            static private JTextField textField_1;
            static private JTextField textField_2;
            static private JTextField txtFire;
            static private JTextField txtSpark;
            static private JTextField txtGas;
            static private JTextField txtTemp;
            static private JTextField textField;


                                                         - 887 -
   882   883   884   885   886   887   888   889   890   891   892