IMG-LOGO
×

Tài Liệu Học

Khoá học lập trình Java Core nâng cao

Exception & Collection

[Video] Tìm hiểu exception + debug + package - lập trình Java Nâng Cao [Video] Tìm hiểu collections, Sets, Maps và Generic - lập trình java nâng cao [Video] Chương trình quản lý sinh viên bằng HashMap - Java Advanced

File

[Video] Hướng dẫn đọc ghi file FileInputStream, FileOutputStream, ObjectInputStream trong java - lập trình java nâng cao [Video] Bài tập quản lý sách & lưu thông tin trên Files [Video] File - Quản lý thông tin sinh viên [Video] Quản lý thông tin sinh & lưu object file - Java nâng cao [Video] Viết ứng dụng WinRar | WinZip | 7Zip bằng Java - Nén file Java & giải nén file Java - Khoá học Java [Video] Bài tập quản lý bán vé máy bay - java nâng cao

Thread

[Video] Phân tích quản lý ứng dụng trong HĐH (Window, Mac, Linux)-Phân tích Game đa luồng Java [Video] Tìm hiểu Thread - Đồng bộ Thread - lập trình java nâng cao - Bổ sung thêm lớp học mới. [Video] Giải thích synchronized + Lap trinh Java nang cao [Video] Thread thực hiện in ngẫu nhiên các số nguyên và ký tự - Phần 1 [Video] Thread thực hiện in ngẫu nhiên các số nguyên và ký tự & Đông bộ thread + wait notify + synchronized + Java nâng cao - Phần 2 [Video] Synchronized 2 Thread - Bài tập mảng tên + địa chỉ - Java nâng cao [Video] Bài tập ôn luyện tổng hợp File, OOP, Thread trong java [Video] Sử dụng MultiThreading sinh ký tự a-zA-Z trong java

CSDL

[Video] Kết nối MySQL trong java swing JDBC trong java - lập trình java nâng cao [Video] Kết nối CSDL bằng java swing phần 1 - lập trình java nâng cao [Video] Kết nối CSDL bằng java swing phần 2 - lập trình java nâng cao [Video] Chương trình quản lý thư viện Java + XML Java + CSDL Java- SQL Java [Video] Phần mềm quản lý sinh viên MySQL + Java - Chương trình quản lý sinh viên MySQL + Java - Lập Trình Java [Video] Bài Tập Quản Lý Sinh Viên - CSDL - Java Swing [Video] Chương trình quản lý sản phẩm - quản lý tin tức - quản lý bán hàng - Lập trình Java [Video] Chức năng register & login + CSDL - Lập trình Java nâng cao - Phần 1 [Video] Hướng dẫn sử dụng Persistence Java - Kết nối database Java - MySQL Java nâng cao

Design Pattern & Đa Ngôn Ngữ

[Video] Design Pattern lập trình java nâng cao - lập trình java nâng cao

XML & JSON & CSDL

[Video] C1 > Chương trình quản lý sinh viên Java + Import/Export JSON + File - Lập Trình Java [Video] C2 > Chương trình quản lý sinh viên Java + Import/Export JSON + File - Lập Trình Java

Ôn Tập Tổng Quát & Exmination

[Video] Bài tập - Chường trình quản lý sở thú - Lập trình Java - Lập trình Java nâng cao - Phần 1 [Video] Bài tập - Chường trình quản lý sở thú - Lập trình Java - Lập trình Java nâng cao - Phần 2




Trang Chủ Java Advanced XML: Java Swing|FX Quản lý thông tin cá nhân Profile bằng java - import + export XML File

XML: Java Swing|FX Quản lý thông tin cá nhân Profile bằng java - import + export XML File

by GokiSoft.com - 17:13 29/10/2021 7,993 Lượt Xem

Viết tài liệu XML mô tả thông tin cá nhân, sở thích, dụng cụ học tập, ngôn ngữ lập trình bạn thích

Yêu cầu: Khi đọc tài liệu có thể biết được profile của 1 cá nhân duy nhất, xem được thông tin cá nhân, sở thích, ngôn ngữ lập trình của cá nhân đó và các trang thiết bị học tập. Các thẻ phải mô tả chính xác nội dung đang cần diễn đạt (cách đặt tên)


Yêu cầu:

- Tạo ứng dụng Java Swing => quản lý thông tin cá nhân, sở thích, ngôn ngữ lập trình

- Thực hiện chức năng import/export ra file xml

Bình luận



Chia sẻ từ lớp học

Do Trung Duc [T2008A]

Ngày viết: 10:42 12/04/2021



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package PersonXML;

import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author TrungDuc
 */
public class PersonParse extends DefaultHandler {

    List<Person> personList = new ArrayList<>();
    Person person = null;

    boolean isPerson = false;
    boolean isName = false;
    boolean isAge = false;
    boolean isLanguage = false;

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        if (qName.equalsIgnoreCase("person")) {
            isPerson = true;
            person = new Person();
        }

        if (isPerson) {
            if (qName.equalsIgnoreCase("name")) {
                isName = true;
            } else if (qName.equalsIgnoreCase("age")) {
                isAge = true;
            } else if (qName.equalsIgnoreCase("language")) {
                isLanguage = true;
            }
        }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        String str = String.valueOf(ch, start, length);
        if (isPerson) {
            if (isName) {
                person.setName(str);
            } else if (isAge) {
                person.setAge(Integer.parseInt(str));
            } else if (isLanguage) {
                person.setLanguage(str);
            }
        }
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (qName.equalsIgnoreCase("person")) {
            isPerson = false;
            personList.add(person);
            person = null;
        }

        if (isPerson) {
            if (qName.equalsIgnoreCase("name")) {
                isName = false;
            } else if (qName.equalsIgnoreCase("age")) {
                isAge = false;
            } else if (qName.equalsIgnoreCase("language")) {
                isLanguage = false;
            }
        }
    }

}


Do Trung Duc [T2008A]

Ngày viết: 10:41 12/04/2021



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package PersonXML;

/**
 *
 * @author TrungDuc
 */
public class Person {

    String name, language;
    int age;

    public Person() {
    }

    public Person(String name, int age, String language) {
        this.name = name;
        this.language = language;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String toXML() {
        return "	<person>\n"
                + "		<name>" + name + "</name>\n"
                + "		<age>" + age + "</age>\n"
                + "		<language>" + language + "</language>\n"
                + "	</person>\n";
    }

}


Do Trung Duc [T2008A]

Ngày viết: 10:41 12/04/2021



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package PersonXML;

import XMLFile.LibraryParse;
import com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.table.DefaultTableModel;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;

/**
 *
 * @author TrungDuc
 */
public class Main extends javax.swing.JFrame {

    List<Person> personList = new ArrayList<>();
    DefaultTableModel tableModel;
    int index = -1;

    /**
     * Creates new form Main
     */
    public Main() {
        initComponents();
        tableModel = (DefaultTableModel) tblPerson.getModel();

        tblPerson.addMouseListener(new MouseListener() {
            @Override
            public void mouseClicked(MouseEvent e) {
                index = tblPerson.getSelectedRow();
                Person person = personList.get(index);
                txtname.setText(person.getName());
                txtage.setText(String.valueOf(person.getAge()));
                txtlanguage.setText(person.getLanguage());
            }

            @Override
            public void mousePressed(MouseEvent e) {
            }

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }
        });
        readFileXML();
        Display();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        txtname = new java.awt.TextField();
        label1 = new java.awt.Label();
        label2 = new java.awt.Label();
        txtage = new java.awt.TextField();
        label3 = new java.awt.Label();
        txtlanguage = new java.awt.TextField();
        btnSave = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        btnEdit = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblPerson = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        label1.setText("Age");

        label2.setText("Name");

        label3.setText("Language");

        btnSave.setText("Save");
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        btnDelete.setText("Delete");
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });

        btnEdit.setText("Edit");

        tblPerson.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "No", "Name", "Age", "Language"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tblPerson);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(20, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(label1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnSave)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDelete)
                        .addGap(18, 18, 18)
                        .addComponent(btnEdit))
                    .addComponent(txtage, javax.swing.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                    .addComponent(txtlanguage, javax.swing.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                    .addComponent(txtname, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(410, 410, 410))
            .addComponent(jScrollPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(21, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(label2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(label1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(label3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtlanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSave)
                    .addComponent(btnDelete)
                    .addComponent(btnEdit))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>                        

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        String name = txtname.getText();
        int age = Integer.parseInt(txtage.getText());
        String language = txtlanguage.getText();
        Person person = new Person(name, age, language);
        if (index >= 0) {
            personList.set(index, person);
        } else {
            personList.add(person);
        }
        
        saveFileXML();
        Display();

    }                                       

    public String toXML(String personListString) {
        return "<personList>\n"
                + "\n" + personListString
                + "	</personList>";
    }
    
    public void saveFileXML(){
            FileOutputStream fos = null;
            
        try {
            fos = new FileOutputStream("person.xml");
               String personListString = "";
            for (Person person : personList) {
                personListString += person.toXML();
            }
           String contentString = toXML(personListString);
            byte[] data = contentString.getBytes("utf8");
            fos.write(data);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (UnsupportedEncodingException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } finally{
            if(fos != null){
                try {
                    fos.close();
                } catch (IOException ex) {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    }
    
    public void readFileXML(){
        File file = new File("person.xml");
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser parse;
        
        try {
            parse = factory.newSAXParser();
            PersonParse personParse = new PersonParse();
            parse.parse(file, personParse);
            
            personList = personParse.personList;
            
            
        } catch (ParserConfigurationException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SAXException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {                                          
        // TODO add your handling code here:
        if (index >= 0) {
            System.err.println(index);
            int option = JOptionPane.showConfirmDialog(rootPane, "Are you sure to delete!");
            System.err.println(option);
            personList.remove(index);
            index = -1;
        } else {
            JOptionPane.showMessageDialog(rootPane, "Chua chon phan tu de xoa");
        }
    saveFileXML();
        Display();

    }                                         
    public void Display() {
        int i = 1;
        tableModel.setRowCount(0);
        for (Person person : personList) {
            tableModel.addRow(new Object[]{i, person.getName(), person.getAge(), person.getLanguage()});
            i++;
        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnEdit;
    private javax.swing.JButton btnSave;
    private javax.swing.JScrollPane jScrollPane1;
    private java.awt.Label label1;
    private java.awt.Label label2;
    private java.awt.Label label3;
    private javax.swing.JTable tblPerson;
    private java.awt.TextField txtage;
    private java.awt.TextField txtlanguage;
    private java.awt.TextField txtname;
    // End of variables declaration                   
}


Nguyễn Tiến Đạt [T2008A]

Ngày viết: 23:50 08/04/2021


#Interest.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import java.util.ArrayList;

/**
 *
 * @author MyPC
 */
public class Interest {
    String sport, game;
    ArrayList<String> music = new ArrayList<>();

    public Interest() {
    }

    public String getSport() {
        return sport;
    }

    public void setSport(String sport) {
        this.sport = sport;
    }

    public String getGame() {
        return game;
    }

    public void setGame(String game) {
        this.game = game;
    }

    public ArrayList<String> getMusic() {
        return music;
    }

    public void setMusic(String music1) {
        this.music.add(music1);
    }

    @Override
    public String toString() {
        return "sport=" + sport + ", game=" + game + ", music=" + music;
    }
    
}


#LearningEquipment.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import java.util.ArrayList;

/**
 *
 * @author MyPC
 */
public class LearningEquipment {
    String laptop;
    ArrayList<String> bookList = new ArrayList<>();

    public LearningEquipment() {
    }

    public String getLaptop() {
        return laptop;
    }

    public void setLaptop(String laptop) {
        this.laptop = laptop;
    }

    public ArrayList<String> getBookList() {
        return bookList;
    }

    public void setBookList(String book) {
        this.bookList.add(book);
    }

    @Override
    public String toString() {
        return "laptop=" + laptop + ", bookList=" + bookList;
    }
    
}


#Main.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;

/**
 *
 * @author MyPC
 */
public class Main {
    public static void main(String[] args) {
        Personal person;
        try {
            File file = new File("thongtincanhan.xml");
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser parser = factory.newSAXParser();
            PersonalParser personalParser = new PersonalParser();
            parser.parse(file, personalParser);
            person = personalParser.person;
            System.out.println(person);
        } catch (ParserConfigurationException | SAXException | IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}


#Personal.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import java.util.ArrayList;



/**
 *
 * @author MyPC
 */
public class Personal {
    String name, gender, birthday, status;
    ArrayList<Interest> interestList = new ArrayList<>();
    String programLanguage;
    ArrayList<LearningEquipment> equipmentList = new ArrayList<>();

    public Personal() {
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public ArrayList<Interest> getInterestList() {
        return interestList;
    }

    public void setInterestList(ArrayList<Interest> interestList) {
        this.interestList = interestList;
    }

    public String getProgramLanguage() {
        return programLanguage;
    }

    public void setProgramLanguage(String programLanguage) {
        this.programLanguage = programLanguage;
    }

    public ArrayList<LearningEquipment> getEquipmentList() {
        return equipmentList;
    }

    public void setEquipmentList(ArrayList<LearningEquipment> equipmentList) {
        this.equipmentList = equipmentList;
    }

    @Override
    public String toString() {
        return "Personal{" + "name=" + name + ", gender=" + gender + ", birthday=" + birthday + ", status=" + status + ", interestList=" + interestList + ", programLanguage=" + programLanguage + ", equipmentList=" + equipmentList + '}';
    }
    
}


#PersonalFrame.form


<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
  <NonVisualComponents>
    <Component class="java.awt.Label" name="label1">
      <Properties>
        <Property name="text" type="java.lang.String" value="label1"/>
      </Properties>
    </Component>
  </NonVisualComponents>
  <Properties>
    <Property name="defaultCloseOperation" type="int" value="3"/>
  </Properties>
  <SyntheticProperties>
    <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
    <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
  </SyntheticProperties>
  <AuxValues>
    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
  </AuxValues>

  <Layout>
    <DimensionLayout dim="0">
      <Group type="103" groupAlignment="0" attributes="0">
          <Group type="102" alignment="0" attributes="0">
              <EmptySpace max="-2" attributes="0"/>
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
              <EmptySpace max="32767" attributes="0"/>
          </Group>
      </Group>
    </DimensionLayout>
    <DimensionLayout dim="1">
      <Group type="103" groupAlignment="0" attributes="0">
          <Group type="102" alignment="0" attributes="0">
              <EmptySpace max="-2" attributes="0"/>
              <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
              <EmptySpace max="32767" attributes="0"/>
          </Group>
      </Group>
    </DimensionLayout>
  </Layout>
  <SubComponents>
    <Container class="javax.swing.JPanel" name="jPanel1">
      <Properties>
        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
            <TitledBorder title="My profile"/>
          </Border>
        </Property>
      </Properties>

      <Layout>
        <DimensionLayout dim="0">
          <Group type="103" groupAlignment="0" attributes="0">
              <Group type="102" attributes="0">
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Group type="102" attributes="0">
                          <EmptySpace max="-2" attributes="0"/>
                          <Group type="103" groupAlignment="0" attributes="0">
                              <Component id="jLabel5" min="-2" pref="66" max="-2" attributes="0"/>
                              <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/>
                              <Group type="103" alignment="0" groupAlignment="1" attributes="0">
                                  <Component id="txtBirthday" min="-2" pref="343" max="-2" attributes="0"/>
                                  <Group type="102" attributes="0">
                                      <Group type="103" groupAlignment="1" max="-2" attributes="0">
                                          <Component id="jLabel4" max="32767" attributes="0"/>
                                          <Component id="jLabel3" max="32767" attributes="0"/>
                                          <Component id="jLabel2" max="32767" attributes="0"/>
                                          <Component id="jLabel1" max="32767" attributes="0"/>
                                      </Group>
                                      <Group type="103" groupAlignment="0" attributes="0">
                                          <Group type="102" alignment="0" attributes="0">
                                              <EmptySpace min="-2" pref="94" max="-2" attributes="0"/>
                                              <Component id="txtStatus" min="-2" pref="343" max="-2" attributes="0"/>
                                          </Group>
                                          <Group type="102" alignment="1" attributes="0">
                                              <EmptySpace max="-2" attributes="0"/>
                                              <Group type="103" groupAlignment="0" attributes="0">
                                                  <Component id="txtGender" alignment="1" min="-2" pref="343" max="-2" attributes="0"/>
                                                  <Component id="txtName" alignment="1" min="-2" pref="343" max="-2" attributes="0"/>
                                              </Group>
                                          </Group>
                                      </Group>
                                  </Group>
                              </Group>
                              <Component id="jLabel12" alignment="0" min="-2" pref="176" max="-2" attributes="0"/>
                              <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
                                  <Group type="102" alignment="0" attributes="0">
                                      <Group type="103" groupAlignment="0" attributes="0">
                                          <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel9" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel11" alignment="0" min="-2" max="-2" attributes="0"/>
                                      </Group>
                                      <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
                                          <Component id="txtVPOP" max="32767" attributes="0"/>
                                          <Component id="txtUSUK" max="32767" attributes="0"/>
                                          <Component id="txtLanguage" pref="342" max="32767" attributes="0"/>
                                          <Component id="txtGame" alignment="1" max="32767" attributes="0"/>
                                          <Component id="txtSport" alignment="0" max="32767" attributes="0"/>
                                      </Group>
                                  </Group>
                                  <Group type="102" alignment="0" attributes="0">
                                      <Group type="103" groupAlignment="0" attributes="0">
                                          <Component id="jLabel13" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel15" alignment="0" min="-2" max="-2" attributes="0"/>
                                          <Component id="jLabel16" alignment="0" min="-2" max="-2" attributes="0"/>
                                      </Group>
                                      <EmptySpace min="-2" pref="112" max="-2" attributes="0"/>
                                      <Group type="103" groupAlignment="0" attributes="0">
                                          <Component id="txtLaptop" pref="341" max="32767" attributes="0"/>
                                          <Component id="txtBook1" max="32767" attributes="0"/>
                                          <Component id="txtBook2" max="32767" attributes="0"/>
                                      </Group>
                                  </Group>
                              </Group>
                              <Component id="jLabel14" alignment="0" min="-2" max="-2" attributes="0"/>
                          </Group>
                      </Group>
                      <Group type="102" alignment="0" attributes="0">
                          <EmptySpace min="-2" pref="244" max="-2" attributes="0"/>
                          <Component id="btnImport" min="-2" pref="70" max="-2" attributes="0"/>
                          <EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
                          <Component id="btnExport" min="-2" pref="70" max="-2" attributes="0"/>
                      </Group>
                  </Group>
                  <EmptySpace pref="174" max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
        <DimensionLayout dim="1">
          <Group type="103" groupAlignment="0" attributes="0">
              <Group type="102" alignment="0" attributes="0">
                  <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Component id="txtName" min="-2" max="-2" attributes="0"/>
                      <Component id="jLabel1" min="-2" pref="24" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Group type="102" alignment="0" attributes="0">
                          <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
                          <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
                          <Group type="103" groupAlignment="0" max="-2" attributes="0">
                              <Group type="102" attributes="0">
                                  <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
                                  <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
                                  <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
                              </Group>
                              <Group type="102" attributes="0">
                                  <Component id="txtBirthday" min="-2" max="-2" attributes="0"/>
                                  <EmptySpace max="32767" attributes="0"/>
                                  <Component id="txtStatus" min="-2" max="-2" attributes="0"/>
                              </Group>
                          </Group>
                      </Group>
                      <Component id="txtGender" alignment="0" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="1" attributes="0">
                      <Group type="102" attributes="0">
                          <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
                          <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
                          <Group type="103" groupAlignment="1" attributes="0">
                              <Component id="jLabel6" min="-2" max="-2" attributes="0"/>
                              <Component id="txtSport" min="-2" max="-2" attributes="0"/>
                          </Group>
                          <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
                          <Group type="103" groupAlignment="0" attributes="0">
                              <Component id="jLabel7" min="-2" max="-2" attributes="0"/>
                              <Component id="txtGame" min="-2" max="-2" attributes="0"/>
                          </Group>
                          <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
                          <Group type="103" groupAlignment="1" attributes="0">
                              <Group type="102" attributes="0">
                                  <Component id="jLabel8" min="-2" max="-2" attributes="0"/>
                                  <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
                                  <Group type="103" groupAlignment="1" attributes="0">
                                      <Component id="jLabel9" min="-2" max="-2" attributes="0"/>
                                      <Component id="txtUSUK" min="-2" max="-2" attributes="0"/>
                                  </Group>
                                  <EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
                                  <Group type="103" groupAlignment="1" attributes="0">
                                      <Component id="jLabel10" min="-2" max="-2" attributes="0"/>
                                      <Component id="txtVPOP" min="-2" max="-2" attributes="0"/>
                                  </Group>
                                  <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                                  <Component id="jLabel11" min="-2" max="-2" attributes="0"/>
                              </Group>
                              <Component id="txtLanguage" min="-2" max="-2" attributes="0"/>
                          </Group>
                          <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
                          <Component id="jLabel12" min="-2" max="-2" attributes="0"/>
                          <EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
                          <Component id="jLabel13" min="-2" max="-2" attributes="0"/>
                      </Group>
                      <Component id="txtLaptop" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="1" attributes="0">
                      <Group type="102" attributes="0">
                          <Component id="jLabel14" min="-2" max="-2" attributes="0"/>
                          <EmptySpace min="-2" pref="26" max="-2" attributes="0"/>
                          <Component id="jLabel15" min="-2" max="-2" attributes="0"/>
                      </Group>
                      <Component id="txtBook1" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="1" attributes="0">
                      <Component id="jLabel16" min="-2" max="-2" attributes="0"/>
                      <Component id="txtBook2" min="-2" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
                  <Group type="103" groupAlignment="0" attributes="0">
                      <Component id="btnImport" min="-2" pref="35" max="-2" attributes="0"/>
                      <Component id="btnExport" min="-2" pref="35" max="-2" attributes="0"/>
                  </Group>
                  <EmptySpace max="32767" attributes="0"/>
              </Group>
          </Group>
        </DimensionLayout>
      </Layout>
      <SubComponents>
        <Component class="javax.swing.JLabel" name="jLabel1">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Name:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtName">
          <Properties>
            <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
              <Color id="Text Cursor"/>
            </Property>
          </Properties>
          <Events>
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNameActionPerformed"/>
          </Events>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel2">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Gender:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtGender">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel3">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Birthday:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtBirthday">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel4">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Status:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtStatus">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel5">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="14" style="3"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Interest:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel6">
          <Properties>
            <Property name="text" type="java.lang.String" value="Sport:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel7">
          <Properties>
            <Property name="text" type="java.lang.String" value="Game"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel8">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="2"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Music:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel9">
          <Properties>
            <Property name="text" type="java.lang.String" value="US-UK:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel10">
          <Properties>
            <Property name="text" type="java.lang.String" value="V-POP:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtVPOP">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel11">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="1"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Program Language:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtSport">
        </Component>
        <Component class="java.awt.TextField" name="txtGame">
        </Component>
        <Component class="java.awt.TextField" name="txtUSUK">
        </Component>
        <Component class="java.awt.TextField" name="txtLanguage">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel12">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="14" style="3"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Learning Equipment:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel13">
          <Properties>
            <Property name="text" type="java.lang.String" value="Laptop:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtLaptop">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel14">
          <Properties>
            <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
              <Font name="Tahoma" size="13" style="2"/>
            </Property>
            <Property name="text" type="java.lang.String" value="Book List:"/>
          </Properties>
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel15">
          <Properties>
            <Property name="text" type="java.lang.String" value="Book 1:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtBook1">
        </Component>
        <Component class="javax.swing.JLabel" name="jLabel16">
          <Properties>
            <Property name="text" type="java.lang.String" value="Book 2:"/>
          </Properties>
        </Component>
        <Component class="java.awt.TextField" name="txtBook2">
        </Component>
        <Component class="java.awt.Button" name="btnImport">
          <Properties>
            <Property name="label" type="java.lang.String" value="Import"/>
          </Properties>
          <Events>
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImportActionPerformed"/>
          </Events>
        </Component>
        <Component class="java.awt.Button" name="btnExport">
          <Properties>
            <Property name="label" type="java.lang.String" value="Export"/>
          </Properties>
          <Events>
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExportActionPerformed"/>
          </Events>
        </Component>
      </SubComponents>
    </Container>
  </SubComponents>
</Form>


#PersonalFrame.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;

/**
 *
 * @author MyPC
 */
public class PersonalFrame extends javax.swing.JFrame {

    /**
     * Creates new form PersonalFrame
     */
    public PersonalFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        label1 = new java.awt.Label();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtName = new java.awt.TextField();
        jLabel2 = new javax.swing.JLabel();
        txtGender = new java.awt.TextField();
        jLabel3 = new javax.swing.JLabel();
        txtBirthday = new java.awt.TextField();
        jLabel4 = new javax.swing.JLabel();
        txtStatus = new java.awt.TextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtVPOP = new java.awt.TextField();
        jLabel11 = new javax.swing.JLabel();
        txtSport = new java.awt.TextField();
        txtGame = new java.awt.TextField();
        txtUSUK = new java.awt.TextField();
        txtLanguage = new java.awt.TextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        txtLaptop = new java.awt.TextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        txtBook1 = new java.awt.TextField();
        jLabel16 = new javax.swing.JLabel();
        txtBook2 = new java.awt.TextField();
        btnImport = new java.awt.Button();
        btnExport = new java.awt.Button();

        label1.setText("label1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("My profile"));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel1.setText("Name:");

        txtName.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
        txtName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNameActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel2.setText("Gender:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel3.setText("Birthday:");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel4.setText("Status:");

        jLabel5.setFont(new java.awt.Font("Tahoma", 3, 14)); // NOI18N
        jLabel5.setText("Interest:");

        jLabel6.setText("Sport:");

        jLabel7.setText("Game");

        jLabel8.setFont(new java.awt.Font("Tahoma", 2, 13)); // NOI18N
        jLabel8.setText("Music:");

        jLabel9.setText("US-UK:");

        jLabel10.setText("V-POP:");

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N
        jLabel11.setText("Program Language:");

        jLabel12.setFont(new java.awt.Font("Tahoma", 3, 14)); // NOI18N
        jLabel12.setText("Learning Equipment:");

        jLabel13.setText("Laptop:");

        jLabel14.setFont(new java.awt.Font("Tahoma", 2, 13)); // NOI18N
        jLabel14.setText("Book List:");

        jLabel15.setText("Book 1:");

        jLabel16.setText("Book 2:");

        btnImport.setLabel("Import");
        btnImport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImportActionPerformed(evt);
            }
        });

        btnExport.setLabel("Export");
        btnExport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExportActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtBirthday, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(94, 94, 94)
                                            .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(txtGender, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(txtName, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                            .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel6)
                                        .addComponent(jLabel7)
                                        .addComponent(jLabel9)
                                        .addComponent(jLabel10)
                                        .addComponent(jLabel11))
                                    .addGap(27, 27, 27)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(txtVPOP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtUSUK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtLanguage, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE)
                                        .addComponent(txtGame, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtSport, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel13)
                                        .addComponent(jLabel15)
                                        .addComponent(jLabel16))
                                    .addGap(112, 112, 112)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(txtLaptop, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
                                        .addComponent(txtBook1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(txtBook2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                            .addComponent(jLabel14)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(244, 244, 244)
                        .addComponent(btnImport, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(39, 39, 39)
                        .addComponent(btnExport, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(174, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(31, 31, 31)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(29, 29, 29)
                                .addComponent(jLabel4))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(txtBirthday, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(txtGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel6)
                            .addComponent(txtSport, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(28, 28, 28)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(txtGame, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addGap(22, 22, 22)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel9)
                                    .addComponent(txtUSUK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(23, 23, 23)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel10)
                                    .addComponent(txtVPOP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(27, 27, 27)
                                .addComponent(jLabel11))
                            .addComponent(txtLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(31, 31, 31)
                        .addComponent(jLabel12)
                        .addGap(27, 27, 27)
                        .addComponent(jLabel13))
                    .addComponent(txtLaptop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(26, 26, 26)
                        .addComponent(jLabel15))
                    .addComponent(txtBook1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel16)
                    .addComponent(txtBook2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnImport, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnExport, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNameActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtNameActionPerformed

    private void btnImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImportActionPerformed
        // TODO add your handling code here:
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream("thongtincanhan.xml");
            String str = importXML();
            byte[] b = str.getBytes();
            fos.write(b);
        } catch (FileNotFoundException ex) {
            Logger.getLogger(PersonalFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(PersonalFrame.class.getName()).log(Level.SEVERE, null, ex);
        }finally{
            if(fos != null){
                try {
                    fos.close();
                } catch (IOException ex) {
                    Logger.getLogger(PersonalFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
            JOptionPane.showMessageDialog(rootPane, "Import thanh cong!!");
        }
    }//GEN-LAST:event_btnImportActionPerformed

    private void btnExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExportActionPerformed
        // TODO add your handling code here:
        Personal person;
        try {
            File file = new File("thongtincanhan.xml");
            SAXParserFactory factory = SAXParserFactory.newInstance();
            SAXParser parser = factory.newSAXParser();
            PersonalParser personalParser = new PersonalParser();
            parser.parse(file, personalParser);
            person = personalParser.person;
            txtName.setText(person.getName());
            txtGender.setText(person.getGender());
            txtBirthday.setText(person.getBirthday());
            txtStatus.setText(person.getStatus());
            txtSport.setText(person.getInterestList().get(0).getSport());
            txtGame.setText(person.getInterestList().get(0).getGame());
            txtUSUK.setText(person.getInterestList().get(0).getMusic().get(0));
            txtVPOP.setText(person.getInterestList().get(0).getMusic().get(1));
            txtLanguage.setText(person.getProgramLanguage());
            txtLaptop.setText(person.getEquipmentList().get(0).getLaptop());
            txtBook1.setText(person.getEquipmentList().get(0).getBookList().get(0));
            txtBook2.setText(person.getEquipmentList().get(0).getBookList().get(1));
            JOptionPane.showMessageDialog(rootPane, "Export thanh cong!!");
        } catch (ParserConfigurationException | SAXException | IOException ex) {
            Logger.getLogger(PersonalFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }//GEN-LAST:event_btnExportActionPerformed
    
    
    private String importXML(){
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<profile>\n" +
                "	<name>"+txtName.getText()+"</name>\n" +
                "	<gender>"+txtGender.getText()+"</gender>\n" +
                "	<birthday><![CDATA["+txtBirthday.getText()+"]]></birthday>\n" +
                "	<status>"+txtStatus.getText()+"</status>\n" +
                "	<interest>\n" +
                "		<sport>"+txtSport.getText()+"</sport>\n" +
                "		<game>"+txtGame.getText()+"</game>\n" +
                "		<music>\n" +
                "			<us-uk>"+txtUSUK.getText()+"</us-uk>\n" +
                "			<v-pop>"+txtVPOP.getText()+"</v-pop>\n" +
                "		</music>\n" +
                "	</interest>\n" +
                "	<program-language>"+txtLanguage.getText()+"</program-language>\n" +
                "	<learning-equipment>\n" +
                "		<laptop>\n" +
                "			<name>"+txtLaptop.getText()+"</name>\n" +
                "		</laptop>\n" +
                "		<book-list>\n" +
                "			<book>"+txtBook1.getText()+"</book>\n" +
                "			<book>"+txtBook2.getText()+"</book>\n" +
                "		</book-list>\n" +
                "	</learning-equipment>\n" +
                "</profile>";
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PersonalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PersonalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PersonalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PersonalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PersonalFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private java.awt.Button btnExport;
    private java.awt.Button btnImport;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private java.awt.Label label1;
    private java.awt.TextField txtBirthday;
    private java.awt.TextField txtBook1;
    private java.awt.TextField txtBook2;
    private java.awt.TextField txtGame;
    private java.awt.TextField txtGender;
    private java.awt.TextField txtLanguage;
    private java.awt.TextField txtLaptop;
    private java.awt.TextField txtName;
    private java.awt.TextField txtSport;
    private java.awt.TextField txtStatus;
    private java.awt.TextField txtUSUK;
    private java.awt.TextField txtVPOP;
    // End of variables declaration//GEN-END:variables
}


#PersonalParser.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Java2.lesson8.PersonalAnalyse;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author MyPC
 */
public class PersonalParser extends DefaultHandler{
    Personal person = null;
    Interest interest = new Interest();
    LearningEquipment equipment = new LearningEquipment();
    
    boolean isProfile = false;
    boolean isName = false;
    boolean isGender = false;
    boolean isBirthday = false;
    boolean isStatus = false;
    boolean isInterest = false;
    boolean isSport = false;
    boolean isGame = false;
    boolean isMusic = false;
    boolean isUSUK = false;
    boolean isVPOP = false;
    boolean isLanguage = false;
    boolean isEquipment = false;
    boolean isLaptop = false;
    boolean isName1 = false;
    boolean isBookList = false;
    boolean isBook = false;
    
    int check = 0;

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        if(qName.equalsIgnoreCase("profile")){
            person = new Personal();
            isProfile = true;
        }
        if(isProfile){
            if(qName.equalsIgnoreCase("name") && check == 0){
                isName = true;
                check = 1;
            }else if(qName.equalsIgnoreCase("gender")){
                isGender = true;
            }else if(qName.equalsIgnoreCase("birthday")){
                isBirthday = true;
            }else if(qName.equalsIgnoreCase("status")){
                isStatus = true;
            }else if(qName.equalsIgnoreCase("interest")){
                isInterest = true;
            }else if(qName.equalsIgnoreCase("program-language")){
                isLanguage = true;
            }else if(qName.equalsIgnoreCase("learning-equipment")){
                isEquipment = true;
            }
            if(isInterest){
                if(qName.equalsIgnoreCase("sport")){
                    isSport = true;
                }else if(qName.equalsIgnoreCase("game")){
                    isGame = true;
                }else if(qName.equalsIgnoreCase("music")){
                    isMusic = true;
                }
            }
            if(isMusic){
                if(qName.equalsIgnoreCase("us-uk")){
                    isUSUK = true;
                }else if(qName.equalsIgnoreCase("v-pop")){
                    isVPOP = true;
                }
            }
            if(isEquipment){
                if(qName.equalsIgnoreCase("laptop")){
                    isLaptop = true;
                }else if(qName.equalsIgnoreCase("book-list")){
                    isBookList = true;
                }
            }
            if(isLaptop){
                if(qName.equalsIgnoreCase("name")){
                    isName1 = true;
                }
            }
            if(isBookList){
                if(qName.equalsIgnoreCase("book")){
                    isBook = true;
                }
            }
        }
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if(qName.equalsIgnoreCase("profile")){
            isProfile = false;
            person.interestList.add(interest);
            person.equipmentList.add(equipment);
        }
        if(isProfile){
            if(qName.equalsIgnoreCase("name")){
                isName = false;
            }else if(qName.equalsIgnoreCase("gender")){
                isGender = false;
            }else if(qName.equalsIgnoreCase("birthday")){
                isBirthday = false;
            }else if(qName.equalsIgnoreCase("status")){
                isStatus = false;
            }else if(qName.equalsIgnoreCase("interest")){
                isInterest = false;
            }else if(qName.equalsIgnoreCase("program-language")){
                isLanguage = false;
            }else if(qName.equalsIgnoreCase("learning-equipment")){
                isEquipment = false;
            }
            if(isInterest){
                if(qName.equalsIgnoreCase("sport")){
                    isSport = false;
                }else if(qName.equalsIgnoreCase("game")){
                    isGame = false;
                }else if(qName.equalsIgnoreCase("music")){
                    isMusic = false;
                }
            }
            if(isMusic){
                if(qName.equalsIgnoreCase("us-uk")){
                    isUSUK = false;
                }else if(qName.equalsIgnoreCase("v-pop")){
                    isVPOP = false;
                }
            }
            if(isEquipment){
                if(qName.equalsIgnoreCase("laptop")){
                    isLaptop = false;
                }else if(qName.equalsIgnoreCase("book-list")){
                    isBookList = false;
                }
            }
            if(isLaptop){
                if(qName.equalsIgnoreCase("name")){
                    isName1 = false;
                }
            }
            if(isBookList){
                if(qName.equalsIgnoreCase("book")){
                    isBook = false;
                }
            }
        }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        String str = String.valueOf(ch, start, length);
        if(isProfile){
            if(isName){
                person.setName(str);
            }else if(isGender){
                person.setGender(str);
            }else if(isBirthday){
                person.setBirthday(str);
            }else if(isStatus){
                person.setStatus(str);
            }else if(isInterest){
                if(isSport){
                    interest.setSport(str);
                }else if(isGame){
                    interest.setGame(str);
                }else if(isMusic){
                    if(isUSUK){
                        interest.setMusic(str);
                    }else if(isVPOP){
                        interest.setMusic(str);
                    }
                }
                
            }else if(isLanguage){
                person.setProgramLanguage(str);
            }else if(isEquipment){
                if(isLaptop){
                    if(isName1){
                        equipment.setLaptop(str);
                    }
                }else if(isBookList){
                    if(isBook){
                        equipment.setBookList(str);
                    }
                }
                
            }
            
        }
    }
}


NguyenHuuThanh [T1907A]

Ngày viết: 13:00 20/04/2020





/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaimportexportxml02;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;

/**
 *
 * @author abc
 */
public class StudentFrame extends javax.swing.JFrame {
        DefaultTableModel tablemodel;
        List<Student> studentlist = new ArrayList<>();
    /**
     * Creates new form StudentFrame
     */
    public StudentFrame() {
        initComponents();
        
        tablemodel = (DefaultTableModel) tblStudent.getModel();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        txtFullName = new javax.swing.JTextField();
        txtRollNo = new javax.swing.JTextField();
        txtHobby = new javax.swing.JTextField();
        txtLanguage = new javax.swing.JTextField();
        btnSave = new javax.swing.JButton();
        btnImportXML = new javax.swing.JButton();
        btnExportXML = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        txtGender = new javax.swing.JComboBox<>();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblStudent = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("FullName");

        jLabel2.setText("RollNo");

        jLabel3.setText("Hobby");

        jLabel5.setText("Language");

        txtLanguage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtLanguageActionPerformed(evt);
            }
        });

        btnSave.setText("Save");
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        btnImportXML.setText("ImportXML");
        btnImportXML.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImportXMLActionPerformed(evt);
            }
        });

        btnExportXML.setText("ExportXML");
        btnExportXML.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExportXMLActionPerformed(evt);
            }
        });

        jLabel6.setText("Gender");

        txtGender.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));

        tblStudent.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "FullName", "RollNo", "Hobby", "Gender", "Language"
            }
        ));
        jScrollPane1.setViewportView(tblStudent);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(133, 133, 133)
                        .addComponent(btnSave)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jScrollPane1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(76, 76, 76)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel5)
                                .addComponent(jLabel4)
                                .addComponent(jLabel3)
                                .addComponent(jLabel2)
                                .addComponent(jLabel1))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(16, 16, 16)
                                .addComponent(jLabel6)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 123, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtRollNo, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtFullName, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtHobby, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(btnImportXML)
                                    .addGap(137, 137, 137)
                                    .addComponent(btnExportXML))))
                        .addGap(101, 101, 101)))
                .addGap(0, 0, 0))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(61, 61, 61)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(txtFullName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(60, 60, 60)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(txtRollNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(58, 58, 58)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(txtHobby, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(41, 41, 41)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(26, 26, 26)
                .addComponent(jLabel4)
                .addGap(6, 6, 6)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                        .addComponent(jLabel5)
                        .addGap(18, 18, 18))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtLanguage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSave)
                    .addComponent(btnImportXML)
                    .addComponent(btnExportXML))
                .addGap(26, 26, 26)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(62, 62, 62))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 238, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>                        

    private void txtLanguageActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
    }                                           

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        
        String fullname = txtFullName.getText();
        String rollno = txtRollNo.getText();
        String hobby = txtHobby.getText();
        String gender = txtGender.getSelectedItem().toString();
        String language = txtLanguage.getText();
        
        if (rollno.isEmpty() || fullname.isEmpty())
        {
            JOptionPane.showMessageDialog(rootPane, "Pls input");
        }
        
        for (Student student : studentlist)
        {
            if (student.getRollno().equalsIgnoreCase(rollno))
            {
                JOptionPane.showMessageDialog(rootPane, "Already has rollno");
            }
        }
        
        Student std = new Student(fullname , rollno , gender , language , hobby);
        
       studentlist.add(std);
       
        tablemodel.addRow(new Object[] {fullname , rollno , hobby ,gender ,language});
    }                                       

    private void btnExportXMLActionPerformed(java.awt.event.ActionEvent evt) {                                             
        // TODO add your handling code here:
         StringBuilder builder = new StringBuilder();
        for (Student student : studentlist) {
            builder.append(student.getStringXML());
        }
        
        String body = builder.toString();
        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                    "<studentList>\n" +
                                    body+
                    "\n</studentList>";
        //save into file student.xml
        FileOutputStream fos = null;
        
        try {
            fos = new FileOutputStream("student.xml");
            
            byte[] data = xml.getBytes();
            
            fos.write(data);
        } catch(Exception e) {
            e.printStackTrace();
        } finally {
            if(fos != null) {
                try {
                    fos.close();
                } catch (IOException ex) {
                    Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        
        JOptionPane.showMessageDialog(rootPane, "Save success!!!");
        
    }                                            

    private void btnImportXMLActionPerformed(java.awt.event.ActionEvent evt) {                                             
        // TODO add your handling code here:
        FileInputStream fis = null;
        
        try {
            fis = new FileInputStream("student.xml");
            SAXParserFactory factory = SAXParserFactory.newInstance();
            
            SAXParser parser = factory.newSAXParser();
            
            StudentHandler handler = new StudentHandler();
            
            try {
                parser.parse(fis, handler);
            } catch (IOException ex) {
                Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
            }
            
            studentlist = handler.getStudentlist();
            
            tablemodel.setRowCount(0);
            for(Student student : studentlist)
            {
                tablemodel.addRow(new Object[]{
                    student.getFullname() , student.getRollno() , student.getHobby() , student.getGender() , student.getLanguage()
                });
            }
        } catch (FileNotFoundException ex) {
            Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ParserConfigurationException ex) {
            Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SAXException ex) {
            Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
        } finally 
        {
            if(fis != null)
            {
                try {
                    fis.close();
                } catch (IOException ex) {
                    Logger.getLogger(StudentFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
        
        JOptionPane.showMessageDialog(rootPane, "Import thanh cong");
        
    }                                            

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(StudentFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(StudentFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(StudentFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(StudentFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new StudentFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify                     
    private javax.swing.JButton btnExportXML;
    private javax.swing.JButton btnImportXML;
    private javax.swing.JButton btnSave;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tblStudent;
    private javax.swing.JTextField txtFullName;
    private javax.swing.JComboBox<String> txtGender;
    private javax.swing.JTextField txtHobby;
    private javax.swing.JTextField txtLanguage;
    private javax.swing.JTextField txtRollNo;
    // End of variables declaration                   
}
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaimportexportxml02;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author abc
 */
public class Student {
    String fullname , rollno ,language ,gender , hobby ; 

    public Student(String fullname, String rollno, String language, String gender, String hobby) {
        this.fullname = fullname;
        this.rollno = rollno;
        this.language = language;
        this.gender = gender;
        this.hobby = hobby;
    }
    
    
    
    public Student()
    {
        
    }


    public String getFullname() {
        return fullname;
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getRollno() {
        return rollno;
    }

    public void setRollno(String rollno) {
        this.rollno = rollno;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    @Override
    public String toString() {
        return "Student{" + "fullname=" + fullname + ", rollno=" + rollno + ", language=" + language + ", gender=" + gender + ", hobby=" + hobby + '}';
    }

    
   

    public String getStringXML()
    {
        return "<student>\n" +
"		<rollNo>"+rollno+"</rollNo>\n" +
"		<fullname>"+fullname+"</fullname>\n" +
"		<hobby>"+hobby+"</hobby>\n" +
"		<gender>"+gender+"</gender>\n" +
                "<language>" + language + "</language>" +
"	</student>";
    }
    }
    
    
    
    

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javaimportexportxml02;

import java.util.ArrayList;
import java.util.List;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author abc
 */
public class StudentHandler extends DefaultHandler {
    List<Student> studentlist = new ArrayList<>();
    Student currentStudent = null;
    boolean isFullname = true , isRollNo = true , isGender = true , isHobby = true , isLanguage = true;
    
    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
      if(qName.equalsIgnoreCase("student"))
      {
          currentStudent = new Student();
      }
      else if (qName.equalsIgnoreCase("fullname"))
      {
          isFullname = true ;
      }
      else if (qName.equalsIgnoreCase("rollno"))
      {
          isRollNo = true ;
      }
      else if (qName.equalsIgnoreCase("hobby"))
      {
          isHobby = true ;
      }
      else if (qName.equalsIgnoreCase("gender"))
      {
          isGender = true ;
      }
      else if (qName.equalsIgnoreCase("language"))
      {
          isLanguage = true ;
      }
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
       if(qName.equalsIgnoreCase("student"))
       {
           studentlist.add(currentStudent);
           currentStudent = null;
       }
       else if (qName.equalsIgnoreCase("fullname"))
       {
           isFullname = false;
       }
       else if (qName.equalsIgnoreCase("rollno"))
      {
          isRollNo = false ;
      }
      else if (qName.equalsIgnoreCase("hobby"))
      {
          isHobby = false ;
      }
      else if (qName.equalsIgnoreCase("gender"))
      {
          isGender = false ;
      }
      else if (qName.equalsIgnoreCase("language"))
      {
          isLanguage =  false ;
      }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        String value = new String(ch, start, length);
       if (isFullname)
       {
           currentStudent.setFullname(value);
       }
       if (isRollNo)
       {
           currentStudent.setRollno(value);
       }
       if (isHobby)
       {
           currentStudent.setHobby(value);
       }
       if(isGender)
       {
           currentStudent.setGender(value);
       }
       if(isLanguage)
       {
           currentStudent.setLanguage(value);
       }
    }

    public StudentHandler() {
    }

    public List<Student> getStudentlist() {
        return studentlist;
    }
    
    
    
}



Phân Loại Bài Viết

Tài Liệu Tham Khảo

Đã sao chép!!!