Java mengimplementasikan buku alamat siswa, menggunakan file XML sebagai penyimpanan data, dan mengimplementasikan fungsi menambah, menghapus, memodifikasi, mencari, mencadangkan, memulihkan, pencarian klasifikasi profesional nomor siswa, nama, usia, alamat, jurusan, ulang tahun, dan informasi lainnya.
Proyek perlu mengimpor paket DOM4J.JAR.
/*Tambahkan catatan siswa*/impor java.awt.borderlayout; impor java.awt.eventqueue; import javax.swing.buttongroup; import javax.swing.jframe; impor javax.swing.jpanel; impor javax.swing.border.emptyborder; impor javax. javax.swing.joptionpane; impor java.awt.font; impor java.awt.event.actionevent; impor java.awt.event.actionlistener; impor javax.swing.jtextfield; impor javax.swing.jradiobutton; impor javax.swing memperluas jframe {private jpanel contentPane; Private JTextfield JT1; Private JTextfield JT2; Private JTextfield JT3; Private JTextfield JT4; Private JTextfield JT5; Private JTextfield JT6; Private JTextfield JT7; Public AddPerson () {setDefaultCloseOperation (jframe.exit_on_close); setbounds (100, 100, 450, 489); ContentPane = jpanel baru (); contentpane.setborder (baru kosong (5, 5, 5, 5)); contentpane.setLayout (null); setContentPane (ContentPane); Jlabel JL1 = JLabel baru ("Buku Alamat Siswa"); jl1.setfont (font baru ("songyi", font.plain, 16)); jl1.setbounds (10, 0, 95, 29); contentpane.add (jl1); Jlabel JL2 = JLabel baru ("Nomor Siswa"); jl2.setfont (font baru ("Songyi", font.plain, 16)); jl2.setbounds (51, 39, 65, 29); contentpane.add (jl2); Jlabel JL3 = JLabel baru ("Nama Siswa"); jl3.setfont (font baru ("Songyi", font.plain, 16)); jl3.setbounds (51, 78, 65, 29); contentpane.add (jl3); Jlabel JL4 = JLabel baru ("Jenis Kelamin Siswa"); jl4.setfont (font baru ("Songyi", font.plain, 16)); jl4.setbounds (51, 117, 65, 29); contentpane.add (jl4); Jlabel JL5 = Jlabel baru ("usia siswa"); JL5.SetFont (font baru ("Songyi", Font.Plain, 16)); jl5.setbounds (51, 163, 65, 29); contentpane.add (jl5); Jlabel jl6 = jlabel baru ("tanggal lahir"); jl6.setfont (font baru ("宋体", font.plain, 16)); jl6.setbounds (51, 202, 65, 29); contentpane.add (jl6); Jlabel JL7 = JLabel baru ("宋体"); jl7.setfont (font baru ("宋体", font.plain, 16)); jl7.setbounds (51, 250, 65, 29); contentpane.add (jl7); Jlabel JL8 = JLabel baru ("email"); jl8.setfont (font baru ("zongyi", font.plain, 16)); jl8.setbounds (51, 296, 65, 29); contentpane.add (jl8); Jlabel JL9 = JLabel baru ("Alamat Rumah"); jl9.setfont (font baru ("zongyi", font.plain, 16)); jl9.setbounds (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL9 = JLabel baru ("Alamat Rumah"); jl9.setfont (font baru ("zongyi", font.plain, 16)); jl9.setbounds (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL10 = JLabel baru ("Nama Profesional"); jl10.setfont (font baru ("宋体", font.plain, 16)); jl10.setbounds (51, 389, 65, 29); contentpane.add (jl10); jt1 = jTextField baru (); jt1.setbounds (129, 38, 150, 34); contentpane.add (jt1); JT1.SetColumns (10); jt2 = jTextField baru (); jt2.setColumns (10); jt2.setbounds (129, 83, 150, 34); contentpane.add (jt2); JT3 = JTextField baru (); jt3.setColumns (10); jt3.setbounds (129, 163, 150, 34); contentpane.add (jt3); JT4 = JTextField baru (); jt4.setColumns (10); jt4.setbounds (129, 201, 150, 34); contentpane.add (jt4); JT5 = JTextField baru (); JT5.SetColumns (10); jt5.setbounds (129, 250, 150, 34); contentpane.add (jt5); jt6 = jTextField baru (); JT6.SetColumns (10); jt6.setbounds (129, 301, 150, 34); contentpane.add (jt6); JT7 = JTextField baru (); JT7.SetColumns (10); jt7.setbounds (129, 350, 150, 34); contentpane.add (jt7); Jradiobutton radiobutton = jradiobutton baru ("laki -laki", benar); Radiobutton.setbounds (139, 121, 65, 23); ContentPane.Add (RadioButton); Jradiobutton radiobutton_1 = jradiobutton baru ("wanita"); RadioButton_1.setbounds (221, 121, 121, 23); contentpane.add (RadioButton_1); Buttongroup bb = new Buttongroup (); BB.Add (RadioButton); BB.Add (Radiobutton_1); jbutton jb1 = jbutton baru ("add"); jb1.setfont (font baru ("zongyi", font.plain, 16)); jb1.setbounds (314, 78, 110, 110, 61); Jbutton baru ("tutup"); jb2.setfont (font baru ("zongyi", font.plain, 16)); jb2.setbounds (314, 167, 110, 61); contentpane.add (jb2); jbutton jb3 = new jbutton ("clear"); jb2); jbutton jb3 = jbutton new jbutton ("clear"); jb3.set); 16)); jb3.setbounds (314, 265, 110, 61); contentpane.add (jb3); string str1 [] = {"Ilmu dan Teknologi Komputer", "Keamanan Informasi", "Ilmu dan Teknologi Informasi Elektronik", "Rekayasa Jaringan"}; JComboBox Combobox = New JCOMBOBOX (STR1); ; comboBox.setbounds (126, 400, 155, 29); contentpane.add (comboBox); jb1.addactionListener (ActionListener baru () {public void actionPerformed (actionEvent arg0) {personoperatordome ppp = new personoperatordome (); if (ppp.serachpersonbool (jt1.gettext ()) {joptionpane.serachpeupReage (null eved (null () {JOptionPane. {Orang = orang baru (); pp.setsex (seks); pp.setMajor (String.ValueOf (ComboBox.GetSelectEdItem ())); jb3.addactionListener (actionListener () {@Override public void actionPerformed (actionEvent arg0) {// TODO Metode yang dihasilkan secara otomatis Stub jt1.setText (""); jt2.setext (""); jt3.settext (""); jt4.setText (""); jt3.settext (""); jt4.settext (""); jt3.settext (""); jt4.setText (""); jt3.setText (""); jt4.setText (""); jt3.settext (""); jt4.settext (""); jt3.settext (""); jt4.settext (""); jt7.setText (""); jb2.addactionListener (ActionListener baru () {@Override public void actionPerformed (actionEvent arg0) {// todo Metode yang dihasilkan otomatis stub dispose ();}}); }} /*Kelas informasi orang*/kelas publik {private string id; nama string pribadi; seks string pribadi; usia string pribadi; ulang tahun string pribadi; telepon string pribadi; email string pribadi; alamat string pribadi; Private String Major; string publik getId () {return id; } public void setId (string id) {this.id = id; } public string getName () {return name; } public void setName (name string) {this.name = name; } public string getsex () {return sex; } public void setSex (string sex) {this.sex = sex; } getage string publik () {return usia; } public void setage (String Age) {this.age = usia; } public string getBirthday () {return ulang tahun; } public void setBirthday (string ulang tahun) {this.birthday = ulang tahun; } public string getPhone () {return phone; } public void setPhone (string phone) {this.phone = phone; } public String geteMail () {return email; } public void seteMail (string email) {this.email = email; } public String getAddress () {alamat kembali; } public void setAddress (Alamat String) {this.address = alamat; } public string getMajor () {return mayor; } public void setMajor (String mayor) {this.major = mayor; }} /*Antarmuka Operasi Orang*/Impor org.dom4j.document; Public Interface Personoperator {public void addPerson (orang orang); Public Void UpdatePerson (orang orang); public void deleteperson (string id); Public Person Serachperson (String ID); Public Boolean SerachpersonBool (ID String); public void beifen (); public void huifu ();} Impor java.io.file; impor java.io.fileoutputStream; impor java.util.iterator; impor java.util.list; impor org.dom4j.document; impor org.dom4j.documenthelper; impor org.dom.dom.element; Impor org.dom4j.io.io.io.io.io.ooadspom; org.dom. org.dom4j.io.xmlwriter; kelas publik personoperatordome {public void addPerson (orang orang) {coba {file file = file baru ("e: /person.xml"); Dokumen dokumen = null; Elemen rootelem = null; if (! file.exists ()) {doc = documenthelper.createdocument (); rootelem = doc.addelement ("personlist"); } else {doc = new saxreader (). baca (file); rootelem = doc.getrooteLement (); } Elemen personelem = rootelem.addelement ("orang"); personelem.addattribute ("id", person.getId ()); personelem.addelement ("name"). setext (person.getName ()); personelem.addelement ("sex"). setext (person.getsex ()); personelem.addelement ("usia"). setText (person.getage ()); personelem.addelement ("ulang tahun"). setText (person.getBirthday ()); personelem.addelement ("telepon"). setText (person.getPhone ()); personelem.addelement ("telepon"). setText (person.getPhone ()); personelem.addelement ("telepon"). setText (person.getPhone ()); personelem.addelement ("email"). setext (person.getemail ()); personelem.addelement ("alamat"). setText (person.getAddress ()); personelem.addelement ("mayor"). setext (person.getMajor ()); Xml.writexml (doc); } catch (Exception e) {E.PrintStackTrace (); }} public void updatePerson (orang orang) {dokumen docum = xml.getDocument (); Elemen root = doc.getrooteLement (); Daftar orang = root.elements (); untuk (int i = 0; i <orang. if (person.getId (). Equals (test.attributeValue ("id"))) {for (iterator it = test.elementIterator (); it.hasnext ();) {elemen node = (elemen) it.next (); String type = node.getName (); if ("name" .equals (type)) {node.setText (person.getName ()); } if ("sex" .Equals (type)) {node.setText (person.getsex ()); } if ("Age" .Equals (type)) {node.setText (person.getage ()); } if ("ulang tahun" .Equals (type)) {node.setText (person.getBirthday ()); } if ("phone" .equals (type)) {node.setText (person.getPhone ()); } if ("email" .Equals (type)) {node.setText (person.geteMail ()); } if ("alamat" .Equals (type)) {node.setText (person.getAddress ()); } if ("mayor" .Equals (type)) {node.setText (person.getMajor ()); }}}} Xml.writexml (doc); } public void beifen () {document doc1 = xml.getDocument (); coba {file file = file baru ("e: /persondome.xml"); Dokumen dokumen = null; Elemen rootelem = null; if (! file.exists ()) {doc = documenthelper.createdocument (); rootelem = doc.addelement ("personlist"); } else {doc = new saxreader (). baca (file); rootelem = doc.getrooteLement (); }} catch (Exception e) {e.printstacktrace (); } coba {// 3. Tulis dokumen ke file xml fileOutputStream out = new fileoutputStream ("e: /persondome.xml"); // format penulisan (format indah) outputFormat format = outputFormat.createPrettyPrint (); format.setencoding ("UTF-8"); Xmlwriter writer = xmlwriter baru (out, format); writer.write (doc1); writer.close (); } catch (Exception e) {E.PrintStackTrace (); lempar runimeException baru (); }} public void huifu () {document doc1 = xml.getDocument1 (); coba {fileOutputStream out = new FileOutputStream ("e: /Person.xml"); OutputFormat format = outputFormat.createPrettyPrint (); format.setencoding ("UTF-8"); Xmlwriter writer = xmlwriter baru (out, format); writer.write (doc1); writer.close (); } catch (Exception e) {E.PrintStackTrace (); lempar runimeException baru (); }} public void deletePerson (string id) {document doc = xml.getDocument (); Elemen root = doc.getrooteLement (); Daftar orang = root.elements (); untuk (int i = 0; i <orang. if (id.equals (test.attributeValue ("id"))) {test.detach (); merusak; }} Xml.writexml (doc); } public boolean serachpersonBool (string id) {document doc = xml.getDocument (); Elemen root = doc.getrooteLement (); Daftar orang = root.elements (); Orang orang = orang baru (); untuk (int i = 0; i <orang. if (id.equals (test.attributeValue ("id"))) {return true; }} return false; } orang publik serachperson (string id) {document doc = xml.getDocument (); Elemen root = doc.getrooteLement (); Daftar orang = root.elements (); Orang orang = orang baru (); untuk (int i = 0; i <orang. if (id.equals (test.attributeValue ("id"))) {for (iterator it = test.elementIterator (); it.hasnext ();) {elemen node = (elemen) it.next (); String type = node.getName (); if ("name" .equals (type)) {person.setName (node.getText ()); } if ("sex" .Equals (type)) {person.setsex (node.getText ()); } if ("Age" .Equals (type)) {person.setage (node.getText ()); } if ("ulang tahun" .Equals (type)) {person.setBirthday (node.getText ()); } if ("phone" .equals (type)) {person.setemail (node.getText ()); } if ("phone" .equals (type)) {person.setemail (node.getText ()); } if ("alamat" .Equals (type)) {person.setAddress (node.getText ()); } if ("mayor" .Equals (type)) {person.setMajor (node.getText ()); }}}} return orang; }} / *Temukan */impor java.awt.borderlayout; impor java.awt.eventqueue; impor javax.swing.buttongroup; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emptydorder; impor javax.jaxswing. java.awt.font; impor java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jtextfield; import javax.swing.jradiobutton; import javax.jbutton; impor javax.swing.jcombuxon; ContentPane; Private JTextfield JT1; Private JTextfield JT2; Private JTextfield JT3; Private JTextfield JT4; Private JTextfield JT5; Private JTextfield JT6; Private JTextfield JT7; serachperson publik () {setDefaultCloseOperation (jframe.exit_on_close); setbounds (100, 100, 450, 489); ContentPane = jpanel baru (); contentpane.setborder (baru kosong (5, 5, 5, 5)); contentpane.setLayout (null); setContentPane (ContentPane); Jlabel JL1 = JLabel baru ("Buku Alamat Siswa"); jl1.setfont (font baru ("songyi", font.plain, 16)); jl1.setbounds (10, 0, 95, 29); contentpane.add (jl1); Jlabel JL2 = JLabel baru ("Nomor Siswa"); jl2.setfont (font baru ("Songyi", font.plain, 16)); jl2.setbounds (51, 39, 65, 29); contentpane.add (jl2); Jlabel JL3 = JLabel baru ("Nama Siswa"); jl3.setfont (font baru ("Songyi", font.plain, 16)); jl3.setbounds (51, 78, 65, 29); contentpane.add (jl3); Jlabel JL4 = JLabel baru ("Jenis Kelamin Siswa"); jl4.setfont (font baru ("Songyi", font.plain, 16)); jl4.setbounds (51, 117, 65, 29); contentpane.add (jl4); Jlabel JL5 = Jlabel baru ("usia siswa"); JL5.SetFont (font baru ("Songyi", Font.Plain, 16)); jl5.setbounds (51, 163, 65, 29); contentpane.add (jl5); Jlabel jl6 = jlabel baru ("tanggal lahir"); jl6.setfont (font baru ("宋体", font.plain, 16)); jl6.setbounds (51, 202, 65, 29); contentpane.add (jl6); Jlabel JL7 = JLabel baru ("宋体"); jl7.setfont (font baru ("宋体", font.plain, 16)); jl7.setbounds (51, 250, 65, 29); contentpane.add (jl7); Jlabel JL8 = JLabel baru ("email"); jl8.setfont (font baru ("zongyi", font.plain, 16)); jl8.setbounds (51, 296, 65, 29); contentpane.add (jl8); Jlabel JL9 = JLabel baru ("Alamat Rumah"); jl9.setfont (font baru ("zongyi", font.plain, 16)); jl9.setbounds (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL9 = JLabel baru ("Alamat Rumah"); jl9.setfont (font baru ("zongyi", font.plain, 16)); jl9.setbounds (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL10 = JLabel baru ("Nama Profesional"); jl10.setfont (font baru ("宋体", font.plain, 16)); jl10.setbounds (51, 389, 65, 29); contentpane.add (jl10); jt1 = jTextField baru (); jt1.setbounds (129, 38, 150, 34); contentpane.add (jt1); JT1.SetColumns (10); jt2 = jTextField baru (); jt2.setColumns (10); jt2.setbounds (129, 83, 150, 34); contentpane.add (jt2); JT3 = JTextField baru (); jt3.setColumns (10); jt3.setbounds (129, 163, 150, 34); contentpane.add (jt3); JT4 = JTextField baru (); jt4.setColumns (10); jt4.setbounds (129, 201, 150, 34); contentpane.add (jt4); JT5 = JTextField baru (); JT5.SetColumns (10); jt5.setbounds (129, 250, 150, 34); contentpane.add (jt5); jt6 = jTextField baru (); JT6.SetColumns (10); jt6.setbounds (129, 301, 150, 34); contentpane.add (jt6); JT7 = JTextField baru (); JT7.SetColumns (10); jt7.setbounds (129, 350, 150, 34); contentpane.add (jt7); Jradiobutton radiobutton = jradiobutton baru ("laki -laki", benar); Radiobutton.setbounds (139, 121, 65, 23); ContentPane.Add (RadioButton); Jradiobutton radiobutton_1 = jradiobutton baru ("wanita"); Radiobutton_1.setbounds (221, 121, 79, 23); contentpane.add (RadioButton_1); Buttongroup bb = new Buttongroup (); BB.Add (Radiobutton); BB.Add (Radiobutton_1); jbutton jb1 = jbutton baru ("find"); jb1.setfont (font baru ("宋体", font.plain, 16); jb1.setbounds (314, 78, 110, 61, 61); jb1.ad (314, 78, 110, 61, 61); JButton("宋体");jb2.setFont(new Font("宋体", Font.PLAIN, 16));jb2.setBounds(314, 280, 110, 61);contentPane.add(jb2);JButton jb3 = new JButton("Clear");jb3.setFont(new Font("Chengyi", Font.PLAIN, 16));jb3.setBounds(314, 357, 110, 61);contentPane.add(jb3);JButton jb4 = new JButton("Modify");jb4.setFont(new Font("Chengyi", Font.PLAIN, 16));jb4.setBounds(314, 174, 110, 61); ContentPane.Add (JB4); String str1 [] = {"Ilmu dan Teknologi Komputer", "Keamanan Informasi", "Ilmu dan Teknologi Informasi Elektronik", "Teknik Jaringan"}; JComboBox Combobox = JComboBox baru (str1); ComboBox.setbounds (126, 394, 153, 29); Content. jb1.addactionListener (ActionListener baru () {public void actionPerformed (actionEvent arg0) {personoperatordome person = new personoperatordome (); string id = jt1.getText (); person pp = person.serachperson (id); jt2.settext (p.getname ()); if (RadioButton.getText (). jt6.settext (pp.getemail ()); if (pp.getMajor (). Equals ("Ilmu dan Teknologi Informasi Elektronik")) ComboBox.SetselectedIndex (2); JB3.AddActionListener (ActionListener baru () {@Override public void actionPerformed (actionEvent e) {// TODO Metode yang dihasilkan secara otomatis Stub jt1.setText (""); jt2.setext (""); jt3.setText (""); jt4.settext (""); jt. jt7.setText (""); jb2.addactionListener (ActionListener baru () {@Override public void actionPerformed (actionEvent arg0) {// todo Metode yang dihasilkan otomatis stub dispose ();}}); jb4.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Person pp=new Person(); PersonOperatorDome person=new PersonOperatorDome(); String sex; if(radioButton.isSelected()) { sex=radioButton.getText(); } else { sex=radioButton_1.getText(); } pp.setid (JT1.GETTEXT ()); pp.setAddress (jt7.getText ()); }} impor java.io.file; impor java.io.fileoutputStream; impor org.dom4j.document; impor org.dom4j.io.outputformat; impor org.dom4j.io.saxreader; impor org.dom4j.xmlwriter; Dokumen Public Class XML {Public Static Document (Public Static Document (public document (public class public class public class xml {public class class public class xml {publik publik Saxreader (). Baca (file baru ("e: /person.xml")); Kembalikan Doc; } catch (Exception e) {E.PrintStackTrace (); Lempar RuntimeException baru (E); }} public static Document getDocument1 () {try {document doc = new saxreader (). baca (file baru ("e: /persondome.xml")); Kembalikan Doc; } catch (Exception e) {E.PrintStackTrace (); Lempar RuntimeException baru (E); }} /** Tuliskan file xml* /public static void writexml (dokumen dok) {coba {// 3. Tulis dokumen ke file xml fileOutputStream out = new fileoutputStream ("e: /person.xml"); // format menulis (format indah) outputFormat format = outputFormat.createPrettyPrint (); format.setencoding ("UTF-8"); Xmlwriter writer = xmlwriter baru (out, format); writer.write (doc); writer.close (); } catch (Exception e) {E.PrintStackTrace (); lempar runimeException baru (); }}} impor java.awt.borderlayout; impor java.awt.eventqueue; import javax.swing.jframe; impor javax.swing.jpanel; impor javax.swing.border.emptyborder; import javax.swing.buttongroup; impor javax.swing.jbutton; java.awt.event.actionevent; impor java.awt.event.actickener; impor java.util.list; import javax.swing.jtextarea; impor javax.swing.jscrollbar; impor javax.jscrollpan; impor javax.swing.swing javax.swing.jradiobutton; import javax.swing.jtable; import javax.swing.table.defaulttableModel; impor org.dom4j.document; impor org.dom4j.element; kelas publik memperpanjang jframe {private jpanel contentpane; tabel jtable pribadi; Public MainContral () {setDefaultCloseOperation (jframe.exit_on_close); setbounds (100, 100, 1200, 392); ContentPane = jpanel baru (); contentpane.setLayout (null); setContentPane (ContentPane); Jbutton jb1 = jbutton baru ("add"); jb1.setfont (font baru ("zongyi", font.plain, 16)); jb1.setbounds (23, 10, 101, 48); contentpane.add (jb1); Jbutton jb3 = jbutton baru ("hapus"); jb3.setfont (font baru ("宋体", font.plain, 16)); jb3.setbounds (134, 10, 101, 48); contentpane.add (jb3); Jbutton jb4 = jbutton baru ("/u67e5/u627e/u4e0e/u4fee/u6539"); jb4.setfont (font baru ("宋体", font.plain, 16)); jb4.setbounds (245, 10, 139, 48); contentpane.add (jb4); Jbutton jb5 = jbutton baru ("show all"); jb5.setfont (font baru ("songyi", font.plain, 16)); jb5.setbounds (394, 10, 126, 48); contentpane.add (jb5); Jradiobutton Radiobutton = Jradiobutton baru ("Ilmu Komputer dan Teknologi"); RadioButton.setfont (font baru ("Songyi", Font.Plain, 16)); Radiobutton.setbounds (23, 89, 161, 23); ContentPane.Add (RadioButton); Jradiobutton radiobutton_1 = jradiobutton baru ("keamanan informasi"); radiobutton_1.setfont (font baru ("zongyi", font.plain, 16)); Radiobutton_1.setbounds (186, 89, 101, 23); contentpane.add (RadioButton_1); Jradiobutton radiobutton_2 = jradiobutton baru ("Ilmu dan Teknologi Informasi Elektronik"); radiobutton_2.setfont (font baru ("zongyi", font.plain, 16)); radiobutton_2.setbounds (289, 89, 174, 23); contentpane.add (RadioButton_2); Jradiobutton radiobutton_3 = jradiobutton baru ("rekayasa jaringan"); radiobutton_3.setfont (font baru ("zongyi", font.plain, 16)); radiobutton_3.setbounds (465, 89, 101, 23); contentpane.add (RadioButton_3); Jradiobutton radiobutton_4 = jradiobutton baru ("all"); radiobutton_4.setfont (font baru ("宋体", font.plain, 16)); radiobutton_4.setbounds (568, 89, 121, 23); contentpane.add (RadioButton_4); Buttongroup bb = new Buttongroup (); BB.Add (Radiobutton); BB.Add (RadioButton_3); BB.Add (RadioButton_2); BB.Add (RadioButton_1); BB.Add (RadioButton_4); tabel = jtable baru (); Table.setfont (font baru ("宋体", font.plain, 16)); Table.setModel (New DefaultTableModel (Objek Baru [] [] {}, string baru [] {"/u7f16/u53f7", "/u59d3/u540d", "/u6027/u52b", "/u5e74/u9f84", ",", ",", " "/u7535/u8bdd", "/u90ae/u7bb1", "/u5730/u5740", "/u4e13/u4e1a"})); DefaultTableModel model = (defaultTableModel) Table.getModel (); Object[] rowData= {"number","name","gender","age","birthday","phone","email","addRow(rowData); //JScrollPane scroll = new JScrollPane(table); table.setBounds(23, 131, 1100, 212); contentPane.add(table); JButton jb6 = new Jbutton (cadangan "); jb7.setbounds (641, 10, 101, 48); JOPTIONPANE.ShowMessageDialog (NULL, "BACKUP SUCKSI");}}); JOPTIONPANE.ShowMessageDialog (NULL, "Recovery Success");}); JB3.AddActionListener (ActionListener baru () {@Override public void actionPerformed (actionEvent e) {// TODO Metode yang dihasilkan secara otomatis Stub int count1 = Table.getSelectedRow (); string id = Table.getValueat (count1, 0) .toString (); personoperate p. JOPTIONPANE.ShowMessageDialog (NULL, "Hapus dengan sukses");}}); jb5.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { // TODO Auto-generated method stub PersonOperatorDome person=new PersonOperatorDome(); Document doc = XML.getDocument(); Element root=doc.getRootElement(); List persons=root.elements(); DefaultTableModel model = (DefaultTableModel) Table.getModel (); person1.setid (test.attributeValue ("id")); person1.setemail (test.elementtext ("email"); {person1.getid (), person1.getname (), person1.getsex (), person1.getage (), person1.getbirthday (), person1.getphone (), orang (), orang (), RAGETS (), RAGETS (), RAGETS (), RAGETON (), RAGETON (), RAGETS (), RAGETON (), ROWETSON (), RAGETON (), RAGET (), RAGETON (), RAGETON (), RAGETON (), Model. }); Orang (); if (str.equals (test.element ("mayor"). getText ())) {person1.setid (test.attributeValue ("id")); person1.setphone (test.elementtext ("telepon")); person1.setbirthday (test.elementText ("ulang tahun")); person1.getbirthday (), person1.getPhone (), person1.getemail (), person1.getAddress (), person1.getMajor ()}} public.addrow (rowData); // TODE Metode yang dihasilkan secara otomatis Document = xml.getDocument (); model.removerow (model.getRowCount ()-1);} untuk (int i = 0; i <orang. person1.setname (test.elementtext ("name")); person1.setbirthday (test.elementText ("ulang tahun")); person1.getbirthday (), person1.getPhone (), person1.getemail (), person1.getAddress (), person1.getMajor ()}; Metode Stub yang Dihasilkan Auto Document = xml.getDocument (); model.removerow (model.getRowCount ()-1);} untuk (int i = 0; i <orang. person1.setname (test.elementtext ("name")); person1.setbirthday (test.elementtext ("ulang tahun")); person1.getsex (), person1.getage (), person1.getbirthday (), person1.getphone (), person1.getemail (), person1.getAddress (), public1.getMajor () {newatoner (); Void ActionPerformed (ActionEvent arg0) {// TODO Metode Stub Dokumen Auto-Auto = XML.GetDocument () while (model.getRowCount ()> 1) {model.removerow (model.getRowCount ()-1);} untuk (int i = 0; i <orang. person1.setid (test.attributeValue ("id")); person1.setemail (test.elementtext ("email")); person1.getsex (), person1.getage (), person1.getbirthday (), person1.getPhone (), person1.getemail (), person1.getAddress (), person1.getMajor ()}; MainContral ();Di atas adalah semua konten artikel ini. Saya berharap ini akan membantu untuk pembelajaran semua orang dan saya harap semua orang akan lebih mendukung wulin.com.