Java는 학생 주소록을 구현하고, XML 파일을 데이터 저장소로 사용하고, 학생 번호, 이름, 연령, 주소, 메이저, 생일 및 기타 정보의 추가, 삭제, 수정, 검색, 백업, 전문 분류 기능을 추가합니다.
이 프로젝트는 dom4j.jar 패키지를 가져와야합니다.
/*학생 레코드 추가*/import java.awt.borderlayout; import java.awt.eventqueue; import javax.swing.buttongroup; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emptyborder; import javax.swing.jlabel; java.awt.font; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jtextfield; import javax.swing.jradiobutton; import javax.swing.jbutton; import javax.swing.jcombobox; jfreme jprame jpon jpon jpon jpon jpon jpan jpan. 개인 Jtextfield JT1; 개인 Jtextfield JT2; 개인 Jtextfield JT3; 개인 Jtextfield JT4; 개인 Jtextfield JT5; 개인 Jtextfield JT6; 개인 Jtextfield JT7; public addperson () {setDefaultCloseOperation (jframe.exit_on_close); 세트 바운드 (100, 100, 450, 489); ContentPane = 새로운 jpanel (); ContentPane.SetBorder (New Emptyborder (5, 5, 5, 5)); contentpane.setLayout (null); SetContentPane (ContentPane); Jlabel JL1 = New Jlabel ( "학생 주소록"); jl1.setfont (new font ( "songyi", font.plain, 16)); JL1.SetBounds (10, 0, 95, 29); contentpane.add (jl1); Jlabel JL2 = New Jlabel ( "학생 번호"); jl2.setfont (new font ( "songyi", font.plain, 16)); JL2. 세트 바운드 (51, 39, 65, 29); contentpane.add (jl2); Jlabel JL3 = New Jlabel ( "학생 이름"); jl3.setfont (new font ( "songyi", font.plain, 16)); JL3. 세트 바운드 (51, 78, 65, 29); contentpane.add (jl3); Jlabel JL4 = New Jlabel ( "학생 성별"); jl4.setfont (new font ( "songyi", font.plain, 16)); JL4. 세트 바운드 (51, 117, 65, 29); contentpane.add (jl4); Jlabel JL5 = New Jlabel ( "학생 시대"); jl5.setfont (new font ( "songyi", font.plain, 16)); JL5. 세트 바운드 (51, 163, 65, 29); contentpane.add (jl5); Jlabel JL6 = New Jlabel ( "생년월일"); jl6.setfont (new font ( "宋体", font.plain, 16)); JL6. 세트 바운드 (51, 202, 65, 29); contentpane.add (jl6); Jlabel JL7 = New Jlabel ( "宋体"); jl7.setfont (new font ( "宋体", font.plain, 16)); JL7. 세트 바운드 (51, 250, 65, 29); contentpane.add (jl7); Jlabel JL8 = New Jlabel ( "이메일"); jl8.setfont (new font ( "Zongyi", font.plain, 16)); JL8. 세트 바운드 (51, 296, 65, 29); contentpane.add (jl8); Jlabel JL9 = New Jlabel ( "홈 주소"); jl9.setfont (new font ( "Zongyi", font.plain, 16)); JL9. 세트 바운드 (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL9 = New Jlabel ( "홈 주소"); jl9.setfont (new font ( "Zongyi", font.plain, 16)); JL9. 세트 바운드 (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL10 = New Jlabel ( "전문가 이름"); jl10.setfont (new font ( "宋体", font.plain, 16)); JL10. 세트 바운드 (51, 389, 65, 29); contentpane.add (jl10); jt1 = 새로운 jtextfield (); jt1.setbounds (129, 38, 150, 34); contentpane.add (jt1); jt1.setcolumns (10); jt2 = 새로운 jtextfield (); jt2.setcolumns (10); JT2. 세트 바운드 (129, 83, 150, 34); contentpane.add (jt2); jt3 = 새로운 jtextfield (); jt3.setcolumns (10); JT3. 세트 바운드 (129, 163, 150, 34); contentpane.add (jt3); jt4 = 새로운 jtextfield (); jt4.setcolumns (10); JT4. 세트 바운드 (129, 201, 150, 34); contentpane.add (jt4); jt5 = 새로운 jtextfield (); JT5. 세트 컬럼 (10); JT5. 세트 바운드 (129, 250, 150, 34); contentpane.add (jt5); jt6 = 새로운 jtextfield (); jt6.setcolumns (10); JT6. 세트 바운드 (129, 301, 150, 34); contentpane.add (jt6); jt7 = 새로운 jtextfield (); jt7.setColumns (10); JT7. 세트 바운드 (129, 350, 150, 34); contentpane.add (jt7); Jradiobutton radiobutton = New Jradiobutton ( "Male", True); Radiobutton.SetBounds (139, 121, 65, 23); contentpane.add (radiobutton); jradiobutton radiobutton_1 = 새로운 jradiobutton ( "여성"); Radiobutton_1. 세트 바운드 (221, 121, 121, 23); contentpane.add (radiobutton_1); buttongroup bb = new buttongroup (); bb.add (radiobutton); bb.add (radiobutton_1); jbutton jb1 = new Jbutton ( "add"); jb1.setfont (new font ( "Zongyi", font.plain, 16)); jb1.setbounds (314, 78, 110, 61); New Jbutton ( "Close"); JB2.SetFont (New Font ( "Zongyi", font.plain, 16)); JB2.SetBounds (314, 167, 110, 61); contentpane.add (jb2); 16); ; ComboBox.SetBounds (126, 400, 155, 29); contentpane.add (combobox); JB1.AddActionListener (New ActionListener () {public void actionPerformed (ActionEvent arg0) {personoperatordome ppp = new Personoperatordome (); if (ppp.serachpersonbool (jt1.getText ()) {joptionpane.showmessagedialog (이미 aductely,”); {person pperatordome (); pp. pp.setmajor (combobox.getSelectedItem ()); jb3.addactionListener (new ActionListener () {@override public void ActionPerformed (ActionEvent Arg0) {// todo auto-reconeated method stub jt1.settext ( ""); jt2.settext ( ""); jt3.settext ( "); jt4.settext ("); "); jt6.settext ( ""); jb2.addactionListener (new ActionListener () {@override public void ActionPerformed (ActionEvent arg0) {// todo 자동 생성 메소드 스터브 dispose ();}}); }} /*개인 정보 수업*/공개 클래스 개인 {개인 문자열 ID; 개인 문자열 이름; 개인 문자열 섹스; 개인 문자열 시대; 개인 문자열 생일; 개인 문자열 전화; 개인 문자열 이메일; 개인 문자열 주소; 개인 문자열 전공; public String getId () {return id; } public void setId (String id) {this.id = id; } public String getName () {return name; } public void setName (문자열 이름) {this.name = 이름; } public String getSex () {return sex; } public void setsex (String sex) {this.sex = sex; } public String getage () {반환 연령; } public void setage (String Age) {this.age = age; } public String getBirthday () {return birthday; } public void setbirthday (문자열 생일) {this.birthday = 생일; } public String getPhone () {반환 전화; } public void setphone (String Phone) {this.phone = 전화; } public String getEmail () {반환 이메일; } public void seteMail (문자열 이메일) {this.email = 이메일; } public String getAddress () {return address; } public void setAddress (문자열 주소) {this.address = 주소; } public String getmajor () {리턴 메이저; } public void setmajor (String major) {this.major = major; }} /*개인 작동 인터페이스*/import org.dom4j.document; public interface personoperator {public void addperson (개인); 공개 void updateperson (사람); 공개 void deleteperson (문자열 ID); 공공 인사 SARACHPERSON (String ID); 공개 부울 sarachpersonbool (문자열 ID); 공개 void beifen (); 공개 void huifu ();} import java.io.file; import java.io.fileoutputStream; import java.util.iterator; import java.util.list; import org.dom4j.document; import org.dom4j.documentHelper; import org.dom4J.Element; import org.dom4j.io.outpolformat; import org org org. org.dom4j.io.xmlwriter; public class personoperatordome {public void addperson (person person) {try {file file = new File ( "e : /person.xml"); 문서 doc = null; 요소 rootelem = null; if (! file.exists ()) {doc = documentHelper.CreatEdocument (); rootelem = doc.addelement ( "PersonList"); } else {doc = new SaxReader (). read (파일); rootelem = doc.getRootElement (); } 요소 personelem = rootelem.addelement ( "person"); personelem.addattribute ( "id", person.getid ()); personelem.addelement ( "name"). settext (person.getname ()); personelem.addelement ( "sex"). settext (person.getsex ()); personelem.addelement ( "age"). settext (person.getage ()); personelem.addelement ( "생일"). settext (person.getbirthday ()); personelem.addelement ( "전화"). settext (person.getphone ()); personelem.addelement ( "전화"). settext (person.getphone ()); personelem.addelement ( "전화"). settext (person.getphone ()); personelem.addelement ( "이메일"). settext (person.getemail ()); personelem.addelement ( "주소"). settext (person.getAddress ()); personelem.addelement ( "major"). settext (person.getmajor ()); xml.writexml (doc); } catch (예외 e) {e.printstacktrace (); }} public void updatePerson (Person Person) {docum doc = xml.getDocument (); 요소 root = doc.getRootElement (); list persons = root.elements (); for (int i = 0; i <persons.size (); i ++) {요소 test = (요소) person.get (i); if (person.getId (). equals (test.attributeValue ( "id"))) {for (iterator it = test.elementiterator (); it.hasnext ();) {요소 node = (요소) it.next (); 문자열 유형 = 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 ( "생일".equals (type)) {node.settext (person.getBirthday ()); } if ( "phone".equals (type)) {node.settext (person.getphone ()); } if ( "email".equals (type)) {node.settext (person.getemail ()); } if ( "address".equals (type)) {node.settext (person.getAddress ()); } if ( "major".equals (type)) {node.settext (person.getmajor ()); }}}} xml.writexml (doc); } public void beifen () {document doc1 = xml.getDocument (); try {file file = 새 파일 ( "e : /persondome.xml"); 문서 doc = null; 요소 rootelem = null; if (! file.exists ()) {doc = documentHelper.CreatEdocument (); rootelem = doc.addelement ( "PersonList"); } else {doc = new SaxReader (). read (파일); rootelem = doc.getRootElement (); }} catch (예외 e) {e.printstacktrace (); } try {// 3. XML 파일에 문서를 씁니다 FileOutputStream out = new FileOutputStream ( "e : /persondome.xml"); // 형식 쓰기 (아름다운 형식) outputformat format = outputformat.createPrettyPrint (); format.setencoding ( "UTF-8"); xmlwriter writer = new xmlwriter (out, format); Writer.write (Doc1); Writer.close (); } catch (예외 e) {e.printstacktrace (); 새로운 runtimeexception ()을 던지십시오. }} public void huifu () {document doc1 = xml.getDocument1 (); {fileoutputStream out = new FileOutputStream ( "e : /person.xml"); outputformat format = outputformat.createPrettyPrint (); format.setencoding ( "UTF-8"); xmlwriter writer = new xmlwriter (out, format); Writer.write (Doc1); Writer.close (); } catch (예외 e) {e.printstacktrace (); 새로운 runtimeexception ()을 던지십시오. }} public void deleteperson (문자열 id) {document doc = xml.getDocument (); 요소 root = doc.getRootElement (); list persons = root.elements (); for (int i = 0; i <persons.size (); i ++) {요소 test = (요소) person.get (i); if (id.equals (test.attributeValue ( "id"))) {test.detach (); 부서지다; }} xml.writexml (doc); } public boolean sarachpersonbool (문자열 id) {document doc = xml.getDocument (); 요소 root = doc.getRootElement (); list persons = root.elements (); 사람 = 새로운 사람 (); for (int i = 0; i <persons.size (); i ++) {요소 test = (요소) person.get (i); if (id.equals (test.attributeValue ( "id"))) {return true; }} 거짓을 반환합니다. } 공개 개인 sarachperson (문자열 id) {docum doc = xml.getDocument (); 요소 root = doc.getRootElement (); list persons = root.elements (); 사람 = 새로운 사람 (); for (int i = 0; i <persons.size (); i ++) {요소 test = (요소) person.get (i); if (id.equals (test.attributeValue ( "id"))) {for (iterator it = test.elementiterator (); hasnext ();) {element node = (element) it.next (); 문자열 유형 = 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 ( "생일".Equals (type)) {person.setBirthday (node.getText ()); } if ( "phone".Equals (type)) {person.setEmail (node.getText ()); } if ( "phone".Equals (type)) {person.setEmail (node.getText ()); } if ( "address".equals (type)) {person.setAddress (node.getText ()); } if ( "major".equals (type)) {person.setmajor (node.getText ()); }}}} 반품 담당자; }} / *찾기 */가져 오기 java.awt.borderlayout; import java.awt.eventqueue; import javax.swing.buttongroup; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emplyborder; import javax.swing.jlabel; javax.jlabel; java.awt.font; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jtextfield; import javax.swing.jradiobutton; import javax.swing.jbutton; import javax.swing.jcombobox; jframe jpon jpon jpon jpon jpon jpon jpon jpon jpon jpon jpon jpon jpon jpone ContentPane; 개인 Jtextfield JT1; 개인 Jtextfield JT2; 개인 Jtextfield JT3; 개인 Jtextfield JT4; 개인 Jtextfield JT5; 개인 Jtextfield JT6; 개인 Jtextfield JT7; public sarachperson () {setDefaultCloseOperation (jframe.exit_on_close); 세트 바운드 (100, 100, 450, 489); ContentPane = 새로운 jpanel (); ContentPane.SetBorder (New Emptyborder (5, 5, 5, 5)); contentpane.setLayout (null); SetContentPane (ContentPane); Jlabel JL1 = New Jlabel ( "학생 주소록"); jl1.setfont (new font ( "songyi", font.plain, 16)); JL1.SetBounds (10, 0, 95, 29); contentpane.add (jl1); Jlabel JL2 = New Jlabel ( "학생 번호"); jl2.setfont (new font ( "songyi", font.plain, 16)); JL2. 세트 바운드 (51, 39, 65, 29); contentpane.add (jl2); Jlabel JL3 = New Jlabel ( "학생 이름"); jl3.setfont (new font ( "songyi", font.plain, 16)); JL3. 세트 바운드 (51, 78, 65, 29); contentpane.add (jl3); Jlabel JL4 = New Jlabel ( "학생 성별"); jl4.setfont (new font ( "songyi", font.plain, 16)); JL4. 세트 바운드 (51, 117, 65, 29); contentpane.add (jl4); Jlabel JL5 = New Jlabel ( "학생 시대"); jl5.setfont (new font ( "songyi", font.plain, 16)); JL5. 세트 바운드 (51, 163, 65, 29); contentpane.add (jl5); Jlabel JL6 = New Jlabel ( "생년월일"); jl6.setfont (new font ( "宋体", font.plain, 16)); JL6. 세트 바운드 (51, 202, 65, 29); contentpane.add (jl6); Jlabel JL7 = New Jlabel ( "宋体"); jl7.setfont (new font ( "宋体", font.plain, 16)); JL7. 세트 바운드 (51, 250, 65, 29); contentpane.add (jl7); Jlabel JL8 = New Jlabel ( "이메일"); jl8.setfont (new font ( "Zongyi", font.plain, 16)); JL8. 세트 바운드 (51, 296, 65, 29); contentpane.add (jl8); Jlabel JL9 = New Jlabel ( "홈 주소"); jl9.setfont (new font ( "Zongyi", font.plain, 16)); JL9. 세트 바운드 (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL9 = New Jlabel ( "홈 주소"); jl9.setfont (new font ( "Zongyi", font.plain, 16)); JL9. 세트 바운드 (51, 345, 65, 29); contentpane.add (jl9); Jlabel JL10 = New Jlabel ( "전문가 이름"); jl10.setfont (new font ( "宋体", font.plain, 16)); JL10. 세트 바운드 (51, 389, 65, 29); contentpane.add (jl10); jt1 = 새로운 jtextfield (); jt1.setbounds (129, 38, 150, 34); contentpane.add (jt1); jt1.setcolumns (10); jt2 = 새로운 jtextfield (); jt2.setcolumns (10); JT2. 세트 바운드 (129, 83, 150, 34); contentpane.add (jt2); jt3 = 새로운 jtextfield (); jt3.setcolumns (10); JT3. 세트 바운드 (129, 163, 150, 34); contentpane.add (jt3); jt4 = 새로운 jtextfield (); jt4.setcolumns (10); JT4. 세트 바운드 (129, 201, 150, 34); contentpane.add (jt4); jt5 = 새로운 jtextfield (); JT5. 세트 컬럼 (10); JT5. 세트 바운드 (129, 250, 150, 34); contentpane.add (jt5); jt6 = 새로운 jtextfield (); jt6.setcolumns (10); JT6. 세트 바운드 (129, 301, 150, 34); contentpane.add (jt6); jt7 = 새로운 jtextfield (); jt7.setColumns (10); JT7. 세트 바운드 (129, 350, 150, 34); contentpane.add (jt7); Jradiobutton radiobutton = New Jradiobutton ( "Male", True); Radiobutton.SetBounds (139, 121, 65, 23); contentpane.add (radiobutton); jradiobutton radiobutton_1 = 새로운 jradiobutton ( "여성"); Radiobutton_1. 세트 바운드 (221, 121, 79, 23); contentpane.add (radiobutton_1); buttongroup bb = new buttongroup (); bb.add (radiobutton); bb.add (radiobutton_1); jbutton jb1 = new Jbutton ( "find"); jb1.setfont (새 글꼴 ( "宋体", font.plain, 16)); jb1.setbounds (314, 78, 110, 61); JBUTTON ( "ton"); JB2.SetFont (New Font ( "宋体", font.plain, 16)); JB2.SetBounds (314, 280, 110, 61); contentpane.add (jb2); Jbutton JB3 = New JButton ( "Clear"); 16); 61); contentpane.add (jb4); String str1 [] = { "컴퓨터 과학 및 기술", "정보 보안", "전자 정보 과학 및 기술", "네트워크 엔지니어링"}; Jcombobox combobox = new Jcombobox (str1); Combobox.setbounds (126, 394, 153, 29); contentpane.add (compobox); jb1.addactionListener (New ActionListener () {public void actionPerformed (ActionEvent Arg0) {personoperatordome person = new Personoperatordome (); String id = jt1.gettext (); person.serachperson (id); jt2.settext (pp.getname ()); if (radiobutton.gettext ()) {radiobutton.setselected (radiobutton_1.setselected); jt6.settext (pp.getEmail ()) (pp.getAddress (). if (pp.getmajor (). Equals ( "전자 정보 과학 및 기술") combobox.setselectedIndex (pp.getmajor (). jb3.addactionListener (new ActionListener () {@override public void actionPerformed (actionEvent e) {// todo auto-regenated method stub jt1.settext ( ""); jt2.settext ( ""); jt7.settext ( ""); jb2.addactionListener (new ActionListener () {@override public void ActionPerformed (ActionEvent arg0) {// todo 자동 생성 메소드 스터브 dispose ();}}); jb4.addactionListener (new ActionListener () {public void actionPerformed (actionEvent arg0) {person pp = new person (); personoperatordome person = new personoperatordome (); String Sex; if (radiobutton.isselected ()) {exe = radiobutton.gettext (); pp. pp. }} import java.io.file; import java.io.fileoutputStream; import org.dom4j.document; import org.dom4j.io.outputformat; import org.dom4j.io.saxreader; import org.dom4j.io.xmlwriter; public class xml {new sadocumement (new sadoder) {new sadocumement () {new sadoder () 파일 ( "e : /person.xml"); 리턴 DOC; } catch (예외 e) {e.printstacktrace (); 새로운 runtimeexception (e)을 던지십시오. }} public static document getDocument1 () {try {document doc = new SaxReader (). read (새 파일 ( "e : /persondome.xml")); 리턴 DOC; } catch (예외 e) {e.printstacktrace (); 새로운 runtimeexception (e)을 던지십시오. }} /** XML 파일을 쓰십시오* /public static void writexml (document doc) {try {// 3. XML 파일 파일에 문서를 씁니다. fileoutputStream out = new FileOutputStream ( "e : /person.xml"); // 형식 쓰기 (아름다운 형식) outputformat format = outputformat.createPrettyPrint (); format.setencoding ( "UTF-8"); xmlwriter writer = new xmlwriter (out, format); Writer.write (Doc); Writer.close (); } catch (예외 e) {e.printstacktrace (); 새로운 runtimeexception ()을 던지십시오. }}} import java.awt.borderlayout; import java.awt.eventqueue; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emptyborder; import javax.swing.buttongroup; import javax.swing.jbutton; java.awt.event.actionevent; import java.awt.event.actionlistener; import java.util.list; import javax.swing.jtextArea; import javax.swing.jscrollbar; import javax.swing.jscrollpane; import javax.swing.jlist; javax.swing.jradiobutton; import javax.swing.jtable; import javax.swing.table.defaulttablemodel; import org.dom4j.document; import org.dom4j.element; public class maintontral jframe {private jpanel contentpane; 개인 JTable 테이블; public maincontral () {setDefaultCloseOperation (jframe.exit_on_close); 세트 바운드 (100, 100, 1200, 392); ContentPane = 새로운 jpanel (); contentpane.setLayout (null); SetContentPane (ContentPane); JBUTTON JB1 = 새로운 JBUTTON ( "ADD"); jb1.setfont (새 글꼴 ( "Zongyi", font.plain, 16)); JB1. 세트 바운드 (23, 10, 101, 48); contentpane.add (jb1); JBUTTON JB3 = New JButton ( "Delete"); jb3.setfont (new font ( "宋体", font.plain, 16)); JB3. 세트 바운드 (134, 10, 101, 48); contentpane.add (jb3); JBUTTON JB4 = NEW JBUTTON ( "/U67E5/U627E/U4E0E/U4FEE/U6539"); jb4.setfont (new font ( "宋体", font.plain, 16)); JB4. 세트 바운드 (245, 10, 139, 48); contentpane.add (jb4); JBUTTON JB5 = NEW JBUTTON ( "All Show"); jb5.setfont (new font ( "songyi", font.plain, 16)); JB5. 세트 바운드 (394, 10, 126, 48); contentpane.add (jb5); Jradiobutton Radiobutton = New Jradiobutton ( "컴퓨터 과학 기술"); Radiobutton.setfont (New Font ( "Songyi", font.plain, 16)); Radiobutton.SetBounds (23, 89, 161, 23); contentpane.add (radiobutton); Jradiobutton radiobutton_1 = New Jradiobutton ( "정보 보안"); Radiobutton_1.setfont (New Font ( "Zongyi", font.plain, 16)); Radiobutton_1. 세트 바운드 (186, 89, 101, 23); contentpane.add (radiobutton_1); Jradiobutton radiobutton_2 = New Jradiobutton ( "전자 정보 과학 및 기술"); Radiobutton_2.setfont (New Font ( "Zongyi", font.plain, 16)); Radiobutton_2. 세트 바운드 (289, 89, 174, 23); contentpane.add (radiobutton_2); jradiobutton radiobutton_3 = 새로운 jradiobutton ( "네트워크 엔지니어링"); Radiobutton_3. 세트 폰트 (New Font ( "Zongyi", font.plain, 16)); Radiobutton_3. 세트 바운드 (465, 89, 101, 23); contentpane.add (radiobutton_3); jradiobutton radiobutton_4 = 새로운 jradiobutton ( "all"); radiobutton_4.setfont (new font ( "宋体", font.plain, 16)); Radiobutton_4. 세트 바운드 (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); 표 = 새로운 jtable (); table.setfont (new font ( "宋体", font.plain, 16)); table.setModel (new defaultTableModel (새 개체 [] [] [] {}, 새 문자열 [] { "/u7f16/u53f7", "/u59d3/u540d", "/u6027/u522b", "/u5e74/u9f84", "/u751f/u65e5", "/u7535/u8bdd", "/u90ae/u7bb1", "/u5730/u5740", "/u4e13/u4e1a"}); defaultTableModel model = (defaultTableModel) table.getModel (); Object [] rowdata = { "number", "name", "gender", "age", "conge", "birthday", "phone", "adome", "addrow (rowdata); // jscrollpane scroll = new jscrollpane (table); table.setbounds (23, 131, 1100, 212); jbutton (new jb6); JB6. 새로운 글꼴 ( "宋体", Plain, 16); JB7. 세트 바운드 (641, 10, 101, 48); joptionpane.showmessagedialog (null, "백업 성공"); joptionpane.showmessagedialog (null, "복구 성공"); ActionListener () {ActionEvent e) {// todo auto-regended method int count1 = getSelectedRow (count1, 0); joptionpane.showmessagedialog (null, "성공적으로 삭제"); jb5.addactionListener (new ActionListener () {@override public void actionperformed (actionevent arg0) {// todo auto-auto-auto-regenated method stub personoperatordome person = new personoperatordome (); doc = xml.getDocument (); rement root = doc.getRootElement (); list persons (). (defaultTableModel) getModel (); person1. attributevalue ( "id"); Person1. ElementText ( "이메일"); {person1. }); rad radobutton.addactionListener (new ActionListener () {@override public void ActionPerformed (ActionEvent Arg0) {// todo auto-auto-voderated method stub doc = xml.getDocument (); 요소 root = docgetRootElement (); list perferent (); rast ongeT (); Person (); defailtablemodel model = (defaultTableModel) table.getModel (); if (test.element ( "major"). Person1. ElementText ( "전화"); person1. test.elementtext ( "생일"); person1.getEmail (), person1.getAddress (), model.addrow (rowdata); doc = xml.getDocument (); model.removerow (int i = 0; i <persons.size (); i ++에 대한 model.getRowCount ()-1); person1. elementtex ( "name"); person1. test.elementtext ( "생일"); person1.getEmail (), person1.getAddress (), getmajor ()}; xml.getDocument (); model.removerow (int i = 0; i <persons.size (); i ++에 대한 model.getRowCount ()-1); person1. elementtex ( "name"); person1. test.elementtext ( "생일"); person1.getsex (), person1.getbirthday (), person1.getemail (), person1.getmajor ()}; ActionPerformed (ActionEvent Arg0) {// TODE는 DOC = XML.GetDocument (); while (model.getRowCount ()> 1) {model.removerow (int i = 0; i <person.size (); i ++) {eleMent test = (요소) person.get (i); person. attributevalue ( "id"); Person1. ElementText ( "이메일"); person1.getsex (), person1.getbirthday (), person1.getemail (), person1.getmajor ()}; maintral ();위는이 기사의 모든 내용입니다. 모든 사람의 학습에 도움이되기를 바랍니다. 모든 사람이 wulin.com을 더 지원하기를 바랍니다.