private void displayTableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayTableActionPerformed

        // create vector and add column titles
        Vector columnNames = new Vector();
        columnNames.add("Index");
        columnNames.add("Title");
        columnNames.add("Author");
        columnNames.add("Genre");
        columnNames.add("Price");
        columnNames.add("Copies Available");

        // create table 
        JTable jTable2 = new JTable(JTableLibraryView.rowData, columnNames);
        //jTable2.setAutoResizeMode(jTable2.AUTO_RESIZE_OFF);
        jTable2.getColumnModel().getColumn(0).setPreferredWidth(10);
        //jTable2.getColumnModel().getColumn(1).setPreferredWidth(150);
        jTable2.getColumnModel().getColumn(2).setPreferredWidth(120);
        
        DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
        centerRenderer.setHorizontalAlignment(JLabel.CENTER);
        jTable2.getColumnModel().getColumn(0).setCellRenderer(centerRenderer);
        jTable2.getColumnModel().getColumn(5).setCellRenderer(centerRenderer);
        
        
        DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
        rightRenderer.setHorizontalAlignment(JLabel.RIGHT);
        jTable2.getColumnModel().getColumn(4).setCellRenderer(rightRenderer);
        
        // set table model
        DefaultTableModel tableModel = new DefaultTableModel(JTableLibraryView.rowData, columnNames);
        
        // set row sorter 
        TableRowSorter trs = new TableRowSorter(tableModel);
 
        // instantiate inner class Comparator for book indices
        IndexComparator indexComparator = new JTableLibraryView().new IndexComparator();
        
        // instantiate inner class Comparator for book prices
        PriceComparator priceComparator = new JTableLibraryView().new PriceComparator();
        
        // set column 0 to use indexComparator for integer values
        trs.setComparator(0, indexComparator);
  
        // set column 3 to use priceComparator for double values
        trs.setComparator(4, priceComparator); 
        
        // set row sorter for table
        jTable2.setRowSorter(trs);
        
        // add table to scroll pane
        JScrollPane tableScrollPane = new JScrollPane(jTable2);
        jTable2.setAutoCreateRowSorter(false);
        
        // create table JFrame and set properties
        JTableLibraryView tableFrame = new JTableLibraryView();
        tableFrame.add(tableScrollPane, BorderLayout.CENTER);;
        tableFrame.setVisible(true);
    }//GEN-LAST:event_displayTableActionPerformed