O Java implementa o livro de endereços do aluno, usa arquivos XML como armazenamento de dados e implementa as funções de adição, exclusão, modificação, pesquisa, backup, restauração, pesquisa de classificação profissional de números de alunos, nomes, idades, endereço, cursos de nascimento, aniversários e outras informações.
O projeto precisa importar o pacote dom4j.jar.
/*Adicionar registro do aluno*/importar java.awt.borderlayout; importar java.awt.eventQueue; importar javax.swing.buttongroup; importar javax.swing.jframe; import javax.swing.jpanel; import javax.swing.border.emptyBorder; import.swing.jpanel; importação; java.awt.font; importar java.awt.event.actionEvent; importar java.awt.event.actionListener; importar javax.swing.jtextfield; importar javax.swing.jradiobutton; import javax.swing.jbutton; importação javax.jradiobutton; 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 = new jpanel (); contentPane.setborder (New Emptyborder (5, 5, 5, 5)); contentPane.setLayout (NULL); setContentPane (contentPane); Jlabel JL1 = New Jlabel ("Livro de endereços do aluno"); jl1.setFont (New Font ("Songyi", Font.Plain, 16)); jl1.setbounds (10, 0, 95, 29); contentPane.add (JL1); Jlabel jl2 = new jlabel ("número do aluno"); JL2.SetFont (New Font ("Songyi", Font.Plain, 16)); jl2.setbounds (51, 39, 65, 29); contentPane.add (JL2); Jlabel jl3 = new jlabel ("nome do aluno"); JL3.SetFont (New Font ("Songyi", Font.Plain, 16)); JL3.Setbounds (51, 78, 65, 29); contentPane.add (JL3); Jlabel jl4 = new jlabel ("gênero de estudante"); JL4.SetFont (New Font ("Songyi", Font.Plain, 16)); JL4.Setbounds (51, 117, 65, 29); contentPane.add (JL4); Jlabel JL5 = New Jlabel ("Age do Estudante"); JL5.SetFont (New Font ("Songyi", Font.Plain, 16)); JL5.setbounds (51, 163, 65, 29); contentPane.add (JL5); Jlabel JL6 = New Jlabel ("Data de Nascimento"); jl6.setFont (nova fonte ("宋体", font.plain, 16)); jl6.setbounds (51, 202, 65, 29); contentPane.add (JL6); Jlabel jl7 = new jlabel ("宋体"); jl7.setFont (nova fonte ("宋体", font.plain, 16)); jl7.setbounds (51, 250, 65, 29); contentPane.add (JL7); Jlabel jl8 = new jlabel ("email"); jl8.setFont (nova fonte ("Zongyi", font.plain, 16)); jl8.setbounds (51, 296, 65, 29); contentPane.add (JL8); Jlabel jl9 = new jlabel ("endereço residencial"); JL9.SetFont (New Font ("Zongyi", Font.Plain, 16)); JL9.Setbounds (51, 345, 65, 29); contentPane.add (JL9); Jlabel jl9 = new jlabel ("endereço residencial"); JL9.SetFont (New Font ("Zongyi", Font.Plain, 16)); JL9.Setbounds (51, 345, 65, 29); contentPane.add (JL9); Jlabel jl10 = new jlabel ("nome profissional"); jl10.setFont (nova fonte ("宋体", font.plain, 16)); JL10.setbounds (51, 389, 65, 29); contentPane.add (JL10); JT1 = novo JTextfield (); JT1.setbounds (129, 38, 150, 34); contentPane.add (JT1); jt1.setColumns (10); jt2 = new jtextfield (); jt2.setColumns (10); JT2.Setbounds (129, 83, 150, 34); contentPane.add (JT2); JT3 = novo JTextfield (); jt3.setColumns (10); JT3.Setbounds (129, 163, 150, 34); contentPane.add (JT3); JT4 = novo JTextfield (); jt4.setColumns (10); JT4.setBounds (129, 201, 150, 34); contentPane.add (JT4); JT5 = novo JTextfield (); jt5.setColumns (10); jt5.setbounds (129, 250, 150, 34); contentPane.add (JT5); JT6 = novo JTextfield (); jt6.setColumns (10); JT6.setbounds (129, 301, 150, 34); contentPane.add (JT6); JT7 = novo JTextfield (); jt7.setColumns (10); JT7.setbounds (129, 350, 150, 34); contentpane.add (JT7); Jradiobutton Radiobutton = New Jradiobutton ("Masculino", Verdadeiro); radiobutton.setbounds (139, 121, 65, 23); contentpane.add (Radiobutton); Jradiobutton radiobutton_1 = novo Jradiobutton ("feminino"); radiobutton_1.setbounds (221, 121, 121, 23); contentPane.add (radiobutton_1); BlotongRoup bb = new buttongRoup (); bb.add (radiobutton); bb.add (radiobutton_1); jbutton jb1 = new jbutton ("add"); jb1.setFont (new Font ("Zongyi", Font.Plain, 16)); New Jbutton ("Close"); JB2.SetFont (New Font ("Zongyi", Font.Plain, 16)); 16)); JB3.Setbounds (314, 265, 110, 61); ContentPane.add (JB3); String str1 [] = {"Ciência e Tecnologia da Computação", "Segurança da Informação", "Ciência e Tecnologia da Informação Eletrônica", "Engenharia de Rede"}; JomBobox ComboBox = New JCOBOBOX (STR1); ; ComboBox. jb1.addactionListener (new ActionListener () {public void ActionPerformed (ActionEvent arg0) {PersonOperatordome ppp = new PersonOperatordome (); if (ppp.SerAChPersonBool (JT1.getText ()) {JOptionPane.ShowmessagedialOg (nUll; null "null) () {jOptionPane.Showmessagedialog (null" null "») {JOptionPane. {Person pp = novo (); pp.setsex (sexo); pp.setmajor (String.Valueof (Combobox.getSelectedItem ()); jb3.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent Arg0) {// TODO Método Gerado automático Stub JT1.Settext (""); jt6.settext (""); jb2.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent arg0) {// TODO Method Auto-Generated Stub Dispon ();}}); }} /*Classe de informações da pessoa*/classe pública Pessoa {private String ID; nome de string privado; sexo privado de cordas; idade de cordas privadas; aniversário de cordas privadas; telefone de corda privada; e -mail privado de string; endereço de string privado; Principal de cordas privadas; public string getId () {return id; } public void setId (string id) {this.id = id; } public string getName () {return name; } public void setName (nome da string) {this.name = name; } public string getSex () {return Sex; } public void SetSex (sexo de string) {this.sex = sexo; } public String getage () {Age de retorno; } public void setage (idade da string) {this.age = Age; } public string getBirthday () {retornar aniversário; } public void setBirthday (String Birthday) {this.birthday = aniversário; } public string getphone () {return telefone; } public void setPhone (string telefone) {this.phone = telefone; } public String getEmail () {retornar email; } public void setEmail (string email) {this.email = email; } public string getAddress () {retornar endereço; } public void setAddress (endereço da string) {this.address = endereço; } public string getmajor () {return major; } public void setmajor (string major) {this.major = major; }} /*Interface de operação da pessoa*/importar org.dom4j.document; interface pública PersonOperator {public void addPerson (pessoa pessoa); public void updatePerson (pessoa); Public Void Deleteperperson (String ID); pessoa pública serachperson (string id); public boolean SerachpersonBool (ID da string); public void beifen (); public void huifu ();} importar java.io.file; importar java.io.fileOutputStream; importar java.util.iterator; importar java.util.list; importar org.dom4j.document; importação org.dom4j.documentHelper; importar org.dom4j.Element; importação; org.dom4j.io.xmlwriter; classe pública PersonOperatordome {public void addPerson (pessoa pessoa) {try {file file = new File ("e: /person.xml"); Documento doc = null; Elemento rootElem = nulo; if (! file.exists ()) {doc = DocumentHelper.createTocument (); rootelem = doc.adDelement ("PersonList"); } else {doc = new saxReader (). read (arquivo); rootElem = doc.getRootElement (); } Elemento personellem = rootelem.addElement ("pessoa"); Persolem.addattribute ("id", pessoa.getId ()); Persolem.adDelement ("Nome"). SetText (Person.getName ()); Persolem.adDelement ("Sex"). SetText (Person.getSex ()); Persolem.adDelement ("Age"). SetText (PERSON.GETAGE ()); Persolem.AddElement ("Aniversário"). SetText (Person.getBirthday ()); Persolem.adDelement ("telefone"). SetText (Person.getphone ()); Persolem.adDelement ("telefone"). SetText (Person.getphone ()); Persolem.adDelement ("telefone"). SetText (Person.getphone ()); Persolem.adDelement ("Email"). SetText (PERSON.GETEMAIL ()); Pessohelem.adDelement ("endereço"). SetText (Person.getAddress ()); Pessohelem.adDelement ("major"). SetText (Person.getmajor ()); Xml.writexml (doc); } catch (Exceção e) {e.printStackTrace (); }} public void updatePerson (pessoa pessoa) {document doc = xml.getDocument (); Elemento root = doc.getrootelement (); Listar pessoas = root.elements (); for (int i = 0; i <PERSONS.SIZE (); i ++) {elemento teste = (elemento) pessoas.get (i); if (Person.getId (). Equals (test.attributeValue ("id"))) {for (iterator it = test.ElementIterator (); it.hasnext ();) {elemento node = (elemento) it.next (); String type = node.getName (); if ("name" .equals (type)) {node.settext (Person.getName ()); } if ("sexo" .equals (type)) {node.settext (Person.getSex ()); } if ("idade" .equals (type)) {node.settext (PERSON.GETAGE ()); } if ("aniversário" .equals (type)) {node.settext (Person.getBirthday ()); } if ("telefone" .equals (type)) {node.settext (Person.getphone ()); } if ("email" .equals (type)) {node.settext (PERSON.GETEMAIL ()); } if ("endereço" .equals (type)) {node.settext (Person.getAddress ()); } if ("major" .equals (type)) {node.settext (Person.getmajor ()); }}}} Xml.writexml (doc); } public void beifen () {document doc1 = xml.getDocument (); tente {arquivo file = new File ("e: /persondome.xml"); Documento doc = null; Elemento rootElem = nulo; if (! file.exists ()) {doc = DocumentHelper.createTocument (); rootelem = doc.adDelement ("PersonList"); } else {doc = new saxReader (). read (arquivo); rootElem = doc.getRootElement (); }} catch (Exceção e) {e.printStackTrace (); } tente {// 3. Escreva o documento para XML FileOutOutputStream Out = new FileOutputStream ("e: /persondome.xml"); // formato de escrita (formato bonito) outputFormat formato = outputFormat.createprettyPrint (); format.setEncoding ("UTF-8"); Xmlwriter writer = new XMLWriter (out, formato); writer.write (doc1); writer.close (); } catch (Exceção e) {e.printStackTrace (); lançar novo RuntimeTeException (); }} public void huifu () {document doc1 = xml.getDocument1 (); tente {fileOutputStream out = new FileOutputStream ("e: /person.xml"); OutputFormat format = outputFormat.createprettyprint (); format.setEncoding ("UTF-8"); Xmlwriter writer = new XMLWriter (out, formato); writer.write (doc1); writer.close (); } catch (Exceção e) {e.printStackTrace (); lançar novo RuntimeTeException (); }} public void Deleteperson (string id) {document doc = xml.getDocument (); Elemento root = doc.getrootelement (); Listar pessoas = root.elements (); for (int i = 0; i <PERSONS.SIZE (); i ++) {elemento teste = (elemento) pessoas.get (i); if (id.equals (test.attributeValue ("id"))) {test.detach (); quebrar; }} Xml.writexml (doc); } public boolean serachpersonBool (string id) {document doc = xml.getDocument (); Elemento root = doc.getrootelement (); Listar pessoas = root.elements (); Pessoa pessoa = nova pessoa (); for (int i = 0; i <PERSONS.SIZE (); i ++) {elemento teste = (elemento) pessoas.get (i); if (id.equals (test.attributeValue ("id"))) {return true; }} retornar false; } public Person SerachPerson (string id) {document doc = xml.getDocument (); Elemento root = doc.getrootelement (); Listar pessoas = root.elements (); Pessoa pessoa = nova pessoa (); for (int i = 0; i <PERSONS.SIZE (); i ++) {elemento teste = (elemento) pessoas.get (i); if (id.equals (test.attributeValue ("id"))) {for (iterator it = test.Elementiterator (); it.hasnext ();) {elemento node = (elemento) it.next (); String type = node.getName (); if ("name" .equals (type)) {Person.SetName (node.getText ()); } if ("sexo" .equals (tipo)) {Person.SetSex (node.getText ()); } if ("idade" .equals (type)) {Person.setage (node.getText ()); } if ("Aniversário" .equals (tipo)) {Person.SetBirthday (node.getText ()); } if ("telefone" .equals (type)) {Person.setEmail (node.getText ()); } if ("telefone" .equals (type)) {Person.setEmail (node.getText ()); } if ("endereço" .equals (type)) {Person.setAddress (node.getText ()); } if ("major" .equals (type)) {Person.setmajor (node.getText ()); }}}} Retornar pessoa; }} / *Encontre */importar java.awt.borderlayout; importar java.awt.eventQueue; importar javax.swing.buttongroup; importar javax.swing.jframe; import javax.swing.jpanel; importação; java.awt.font; importar java.awt.event.actionEvent; importar java.awt.event.actionListener; importar javax.swing.jtextfield; importar javax.swing.jradiobutton; importexbox; contentpane; Private JTextfield JT1; Private JTextfield JT2; Private JTextfield JT3; Private JTextfield JT4; Private JTextfield JT5; Private JTextfield JT6; Private JTextfield JT7; public SerachPerson () {setDefaultCloseoperation (jframe.exit_on_close); setbounds (100, 100, 450, 489); contentPane = new JPanel (); contentPane.setborder (New Emptyborder (5, 5, 5, 5)); contentPane.setLayout (NULL); setContentPane (contentPane); Jlabel JL1 = New Jlabel ("Livro de endereços do aluno"); jl1.setFont (New Font ("Songyi", Font.Plain, 16)); jl1.setbounds (10, 0, 95, 29); contentPane.add (JL1); Jlabel jl2 = new jlabel ("número do aluno"); JL2.SetFont (New Font ("Songyi", Font.Plain, 16)); jl2.setbounds (51, 39, 65, 29); contentPane.add (JL2); Jlabel jl3 = new jlabel ("nome do aluno"); JL3.SetFont (New Font ("Songyi", Font.Plain, 16)); JL3.Setbounds (51, 78, 65, 29); contentPane.add (JL3); Jlabel jl4 = new jlabel ("gênero de estudante"); JL4.SetFont (New Font ("Songyi", Font.Plain, 16)); JL4.Setbounds (51, 117, 65, 29); contentPane.add (JL4); Jlabel JL5 = New Jlabel ("Age do Estudante"); JL5.SetFont (New Font ("Songyi", Font.Plain, 16)); JL5.setbounds (51, 163, 65, 29); contentPane.add (JL5); Jlabel JL6 = New Jlabel ("Data de Nascimento"); jl6.setFont (nova fonte ("宋体", font.plain, 16)); jl6.setbounds (51, 202, 65, 29); contentPane.add (JL6); Jlabel jl7 = new jlabel ("宋体"); jl7.setFont (nova fonte ("宋体", font.plain, 16)); jl7.setbounds (51, 250, 65, 29); contentPane.add (JL7); Jlabel jl8 = new jlabel ("email"); jl8.setFont (nova fonte ("Zongyi", font.plain, 16)); jl8.setbounds (51, 296, 65, 29); contentPane.add (JL8); Jlabel jl9 = new jlabel ("endereço residencial"); JL9.SetFont (New Font ("Zongyi", Font.Plain, 16)); JL9.Setbounds (51, 345, 65, 29); contentPane.add (JL9); Jlabel jl9 = new jlabel ("endereço residencial"); JL9.SetFont (New Font ("Zongyi", Font.Plain, 16)); JL9.Setbounds (51, 345, 65, 29); contentPane.add (JL9); Jlabel jl10 = new jlabel ("nome profissional"); jl10.setFont (nova fonte ("宋体", font.plain, 16)); JL10.setbounds (51, 389, 65, 29); contentPane.add (JL10); JT1 = novo JTextfield (); JT1.setbounds (129, 38, 150, 34); contentPane.add (JT1); jt1.setColumns (10); jt2 = new jtextfield (); jt2.setColumns (10); JT2.Setbounds (129, 83, 150, 34); contentPane.add (JT2); JT3 = novo JTextfield (); jt3.setColumns (10); JT3.Setbounds (129, 163, 150, 34); contentPane.add (JT3); JT4 = novo JTextfield (); jt4.setColumns (10); JT4.setBounds (129, 201, 150, 34); contentPane.add (JT4); JT5 = novo JTextfield (); jt5.setColumns (10); jt5.setbounds (129, 250, 150, 34); contentPane.add (JT5); JT6 = novo JTextfield (); jt6.setColumns (10); JT6.setbounds (129, 301, 150, 34); contentPane.add (JT6); JT7 = novo JTextfield (); jt7.setColumns (10); JT7.setbounds (129, 350, 150, 34); contentpane.add (JT7); Jradiobutton Radiobutton = New Jradiobutton ("Masculino", Verdadeiro); radiobutton.setbounds (139, 121, 65, 23); contentpane.add (Radiobutton); Jradiobutton radiobutton_1 = novo Jradiobutton ("feminino"); radiobutton_1.setbounds (221, 121, 79, 23); contentPane.add (radiobutton_1); BlotongRoup bb = new buttongRoup (); bb.add (radiobutton); bb.add (radiobutton_1); jbutton jb1 = new jbutton ("find"); jb1.setFont (new font ("宋体", font.plain, 16)); Jbutton ("宋体"); jb2.SetFont (new Font ("宋体", Font.Plain, 16)); 16); 61); contentPane.add (JB4); String str1 [] = {"Ciência da Computação e Tecnologia", "Segurança da Informação", "Ciência e Tecnologia da Informação Eletrônica", "Engenharia de Rede"}; JCombobox ComboBox = New JCombobox (Str1); ComboBox.setbounds (126, 394, 153, 29); jb1.addactionListener (new ActionListener () {public void ActionPerformed (ActionEvent Arg0) {PersonOperatordome pessoa = new PersonOperatordome (); String ID = JT1.getText (); Person Pp = Person.serachPerson (ID); JT2.Settext (Pp.getname (); if (radiobutton.getText (). jt6.settext (pp.getEmail ()); if (pp.getmajor (). igual ("ciência da informação eletrônica e tecnologia")) Combobox.setSelectIndEx (2); jb3.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent E) {// TODO Método Gerado Auto-Gerado Stub JT1.Settext (""); JT2.Settext (""); JT3.Settext ("); jt7.settext (""); jb2.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent arg0) {// TODO Method Auto-Generated Stub Dispon ();}}); jb4.addactionListener (new ActionListener () {public void ActionPerformed (ActionEvent arg0) {pessoa pp = new Person (); PersonOperatordome pessoa = new PersonOperatordome (); String Sex; if (Radiobutton.isselected ()) {sex = Radiobutton.1gTon; pp.setId (JT1.getText (); pp.SetAddress (JT7.getText ()); }} importar java.io.file; importar java.io.fileOutputStream; importar org.dom4j.document; importar org.dom4j.io.outputFormat; importar org.dom4j.io.saxReader; importrtic.dom4j.io.xmlwriter; Arquivo ("e: /person.xml")); retornar doc; } catch (Exceção e) {e.printStackTrace (); lançar nova execução de tempo de execução (e); }} documento estático público getDocument1 () {try {document doc = new saxReader (). read (novo arquivo ("e: /persondome.xml"); retornar doc; } catch (Exceção e) {e.printStackTrace (); lançar nova execução de tempo de execução (e); }} /** Escreva o arquivo xml* /public static void writexml (documento doc) {try {// 3. Escreva o documento para XML FileOututputStream Out = new FileOutputStream ("e: /person.xml"); // formato de escrita (formato bonito) outputFormat formato = outputFormat.createprettyPrint (); format.setEncoding ("UTF-8"); Xmlwriter writer = new XMLWriter (out, formato); writer.write (doc); writer.close (); } catch (Exceção e) {e.printStackTrace (); lançar novo RuntimeTeException (); }}} importar java.awt.borderlayout; importar java.awt.eventQueue; importar javax.swing.jframe; importar javax.swing.jpanel; importar javax.swing.border.memptyborder; import javax.swing.buttonpoup; import.fmwing.jbutter; java.awt.event.actionEvent; importar java.awt.event.actionListener; importar java.util.list; importar javax.swing.jtextarea; importar javax.swing.jscrollbar; import javax.jscrolpane; import.jaxing.jlist; import; import.swing.jscrolpane; import.jaxing.jlist; javax.swing.jradiobutton; importar javax.swing.jtable; importar javax.swing.table.defaultTableModel; importar org.dom4j.document; importar org.dom4j.Element; classe pública Maincontral Extrends {private jpanel contentpane; Tabela Jtable Private; public MainContral () {setDefaultCloseoperation (jframe.exit_on_close); Setbounds (100, 100, 1200, 392); contentPane = new JPanel (); contentPane.setLayout (NULL); setContentPane (contentPane); Jbutton jb1 = new jbutton ("add"); jb1.setFont (New Font ("Zongyi", font.plain, 16)); jb1.setbounds (23, 10, 101, 48); contentPane.add (JB1); Jbutton jb3 = novo jbutton ("delete"); jb3.setFont (nova fonte ("宋体", font.plain, 16)); JB3.setbounds (134, 10, 101, 48); contentPane.add (JB3); Jbutton jb4 = new jbutton ("/u67e5/u627e/u4e0e/u4fee/u6539"); jb4.setFont (nova fonte ("宋体", font.plain, 16)); JB4.setbounds (245, 10, 139, 48); contentPane.add (JB4); Jbutton jb5 = new jbutton ("show all"); jb5.setFont (New Font ("Songyi", Font.Plain, 16)); jb5.setbounds (394, 10, 126, 48); contentPane.add (JB5); Jradiobutton Radiobutton = New Jradiobutton ("Ciência e Tecnologia da Computação"); radiobutton.setFont (New Font ("Songyi", Font.Plain, 16)); radiobutton.setbounds (23, 89, 161, 23); contentpane.add (Radiobutton); Jradiobutton radiobutton_1 = novo Jradiobutton ("Segurança da Informação"); radiobutton_1.setFont (new Font ("Zongyi", font.plain, 16)); radiobutton_1.setbounds (186, 89, 101, 23); contentPane.add (radiobutton_1); Jradiobutton radiobutton_2 = novo Jradiobutton ("Ciência e Tecnologia da Informação Eletrônica"); radiobutton_2.setFont (new Font ("Zongyi", font.plain, 16)); Radiobutton_2.setBounds (289, 89, 174, 23); contentPane.add (radiobutton_2); Jradiobutton radiobutton_3 = novo Jradiobutton ("Engenharia de Rede"); Radiobutton_3.SetFont (New Font ("Zongyi", Font.Plain, 16)); radiobutton_3.setbounds (465, 89, 101, 23); contentPane.add (radiobutton_3); Jradiobutton radiobutton_4 = novo Jradiobutton ("All"); radiobutton_4.setFont (new Font ("宋体", font.plain, 16)); radiobutton_4.setbounds (568, 89, 121, 23); contentPane.add (radiobutton_4); BlotongRoup bb = new buttongRoup (); bb.add (Radiobutton); bb.add (radiobutton_3); bb.add (radiobutton_2); bb.add (radiobutton_1); bb.add (radiobutton_4); tabela = new jTable (); tabela.setFont (nova fonte ("宋体", font.plain, 16)); tabela.setModel (new DefaultTableModel (novo objeto [] [] {}, new String [] {"/u7f16/u53f7", "/u59d3/u540d", "/u6027/u522b,"/u5e74/u9f84 "" "/u522b,"/u5e74/u9f84 "," "/u7535/u8bdd", "/u90e/u7bb1", "/u5730/u5740", "/u4e13/u4e1a"})); DefaultTabLEModel Model = (DefaultTableModel) tabela.getModel (); Objeto [] rowdata = {"número", "nome", "gênero", "idade", "aniversário", "telefone", "email", "addRow (rowdata); // jScrollPane scroll = new jScrollPane (tabela); tabela.setBounds (23, 131, 1100, 212); JBTON (JB6. jb7.setbounds (641, 10, 101, 48); JoptionPane.Showsedialog (NULL, "Sucesso de backup"); JoptionPane.Showsedialog (NULL, "Sucesso de recuperação"); jb3.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent e) {// TODO Método Auto-Gerado Stub int count1 = tabela.getSelectedRow (); string id = tabela.getValuEat (Count1, 0) .ToString (); PessoaTorTaMatomArtome JoptionPane.Showsedialog (NULL, "Excluir com sucesso"); jb5.addactionListener (new ActionListener () {@Override public void ActionPerformed (ActionEvent arg0) {// TODO Método Auto-Gerado Stub PersonOperatordome Pessoa = Novo PersonOperatordome (); (DefaultTableModel) Tabela.getModel (); Person1.SetId (Testname, "ID"); Person1.setBirthday (Test.ElementText ("Aniversário"); Person1.getSex (), Person1.getage (), Person1.getBirthday (), Pessoa. ActionListener () @Override Public Void ACTIONSED (ACTIONECIONAL ACTIONETEM) {// TODO Método gerado (DefaultTableModel) Tabela.getModel (); {Person1.setId (test.attributeValue ("ID"); Person1.setMail (Test.ElementText ("Email"); Person1.SetAddress (Test.ElementText ("Endereço")); Person1.getAddress (), Person1.getmajor ()}; root = doc.getrootElement (); i = 0; i <PERSONS.SIZE (); i ++) {elemento teste = (elemento) PESSONS.GETE (i); Person1.setSex (Test.ElementText ("Sex"); OS -MERDADE (Test.ElementText ("Aniversário"); Person1.getBirthday (), Person1.getphone (), Person1.getEmail (), Person1.getAddress (), Person1.getmajor ()}; TODO Método gerado pelo Documento do STUB = XML.getDocument (); Model.reMoverow (Model.getRowCount ()-1); Person1.setName (Test.ElementText (Nome "); Person1.setBirthday (Test.ElementText ("Aniversário"); Person1.getSex (), Person1.getage (), Person1.getBirthday (), Person1.getphone (), Person1.getEmail (), Person1.getAddress (), PERSON.GETMAJOR () Void ActionPerformed (ACTIONEVENTE ARGI) {// TODO Método Gerado Documento Doc = XML.getDocument (); while (Model.getRowCount ()> 1) {Model.reMoverow (Model.getRowCount ()-1); Person1.setId. Person1.setemily (Test.ElementText ("email"); Person1.getSex (), Person1.getage (), Person1.getBirthday (), Person1.getphone (), Person1.getEmail (), Person1.getAddress (), PERSON.GETMAJOR () MainContral ();O exposto acima é todo o conteúdo deste artigo. Espero que seja útil para o aprendizado de todos e espero que todos apoiem mais o wulin.com.