mainWindow.setLocationRelativeTo(JHack.main.getMainWindow());
    protected void init()    {        readXML(rom);        mainWindow = new JFrame(this.getDescription());        mainWindow.getContentPane().setLayout(new BorderLayout());        JPanel buttons = new JPanel();        buttons.setLayout(new FlowLayout());        JButton apply = new JButton("Apply Patch");        apply.setActionCommand("apply");        apply.addActionListener(this);        buttons.add(apply);        JButton unapply = new JButton("Unapply Patch");        unapply.setActionCommand("unapply");        unapply.addActionListener(this);        buttons.add(unapply);        JButton close = new JButton("Close");        close.setActionCommand("close");        close.addActionListener(this);        buttons.add(close);        mainWindow.getContentPane().add(buttons, BorderLayout.SOUTH);        final String[] columnNames = {"Name", "Author", "Description",            "Screenshot", "Applied?"};        TableModel ipsModel = new AbstractTableModel()        {            public int getColumnCount()            {                return 5;            }            public int getRowCount()            {                int o = 0;                for (int i = 0; i < entries.size(); i++)                {                    if (((DatabaseEntry) entries.get(i)).forRom(rom                        .getRomType()))                        o++;                }                return o;            }            public DatabaseEntry getRow(int row)            {                int r = 0;                for (int i = 0; i < entries.size(); i++)                {                    if (((DatabaseEntry) entries.get(i)).forRom(rom                        .getRomType()))                    {                        if (r == row)                            return (DatabaseEntry) entries.get(r);                        r++;                    }                }                throw new IndexOutOfBoundsException();            }            public Object getValueAt(int row, int col)            {                try                {                    DatabaseEntry e = getRow(row);                    //(IPSDatabaseEntry) entries.get(row);                    switch (col)                    {                        case 0:                            return e.getName();                        case 1:                            return e.getAuthor();                        case 2:                            return e.getSdesc();                        case 3:                            return e.getSs();                        case 4:                            return Boolean.valueOf(e.isApplied());                    }                }                catch (IndexOutOfBoundsException e)                {}                return null;            }            public String getColumnName(int col)            {                return columnNames[col];            }            public Class getColumnClass(int c)            {                return getValueAt(0, c).getClass();            }            public boolean isCellEditable(int row, int col)            {                return false;            }        };        ipsTable = new JTable(ipsModel);        ipsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);        ipsTable.setRowHeight(224);        ipsTable.getColumn(columnNames[0]).setPreferredWidth(90);        ipsTable.getColumn(columnNames[1]).setPreferredWidth(50);        ipsTable.getColumn(columnNames[2]).setPreferredWidth(250);        ipsTable.getColumn(columnNames[3]).setPreferredWidth(256);        ipsTable.getColumn(columnNames[4]).setPreferredWidth(17);        ipsTable.setPreferredScrollableViewportSize(new Dimension(800, 500));        ipsTable.doLayout();        JScrollPane scrollPane = new JScrollPane(ipsTable);        mainWindow.getContentPane().add(scrollPane, BorderLayout.CENTER);        mainWindow.pack();    }