public LibraryServer() {
        setLayout(new BorderLayout());
        add(new JScrollPane(jta), BorderLayout.CENTER);
        
        setTitle("Library Server");
        setSize(500, 300);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
        
        // read library database file
        DataScanner.readFile("test2.txt");
        
        try {
            ServerSocket serverSocket = new ServerSocket(8000);
            jta.append("Library server started at " + new Date() + '\n');

            int clientNum = 1;
            
            while (true) {
                Socket socket = serverSocket.accept();
                jta.append("Starting thread for client " + clientNum +
                        " at " + new Date() + '\n');
                HandleClient task = new HandleClient(socket);
                new Thread(task).start();
                clientNum++;
            }
            
        } catch (IOException e) {
            System.err.println(e);
        }
    }