I was practicing a tutorial on YouTube. Here it is - & gt;
I have checked dozens of codes below but I still can not understand why Jeffrey did not show up correctly. Although I put size 600x400 (or greater), but whenever I did not change anything on running the project, there was no change in the size of This is my code: and beyond From: JFrame , labels did not even show where the problem is?
package doanjava; Import java.sql *; Public Sector DB {Connection Con; Statement cents; Reset the result; Public DB () {Connect (); } Public Zero Connect () {try {string driver = "sun.jdbc.odbc.JdbcOdbcDriver"; Class.forName (driver); String db = "jdbc: odbc: catonoai"; Con = DriverManager.getConnection (DB); St = con.createStatement (); String sql = "Choose from HoSoSinhVien '; Rs = st.executeQuery (SQL); while (rsnext ()) {string ho = r.jest string (" ho "); string ten = r.jest string (" ten " String toei = R.getString ("Tuoi"); String Lop = R.Jest String ("Lop"); String Sovanettiyei = R.Jest String ("SodentiOi"); String Dei = R.Jest String ("Dai "); System.out.println (ho +" "+ ten +" | "+" Tuoi: "+ Tuoi +" | "+" omitted: "+ + + +" + "SDT:" + SoDienThoai + " | "+" Diya Chi: "+ DiaChi); }} Hold (exception before) {}} public static zero main (string [] args) {new db (); New gui (); }}
package doanjava; Import javax.swing *; Public class GUI {JFrame f; Be Jebelbell; Jlabal ten; Jellabal Tuai; JLABL omitted; JTextField T; JTextField T1; JTextField T2; JTextField T3; Public GUI () {frame (); } Public Zero Frame () {f = New JFrame (); F.setVisible (true); F.setSize (600,400); F.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Ho = new jlabel ("ho"); Ten = new jellabell ("ten"); Tuoi = new jellabell ("Tuoi"); Elimination = new JLABEL ("omitted"); T = new JTextField (10); T1 = new JTextField (10); T2 = new JTextField (10); T3 = new JTextField (10); Jpnal p = new jepinal (); P.add (ho); P.add (t); P.add (ten); P.add (T1); P.add (Tuoi); P.add (t2); P.add (pen); P.add (T3); F.add (p); }}
string = rsgetstring ("ho");
system.out.println (); These values are omitted, and there is no effect on
JLabel
ho = new jellabell ("ho");
pack () .
hold (exception e) {.
hold (exception e) {e.printStackTrace (); // very informative! ..
No comments:
Post a Comment