class AbstractWizardVisualPanel1 extends javax.swing.JPanel {

    protected static final int MAX_ROWS_PREVIEW = 25;

    private final AbstractImporterSpreadsheet importer;
    protected int columnCount = 0;
    protected boolean hasSourceNodeColumn = false;
    protected boolean hasTargetNodeColumn = false;
    protected boolean hasRowsMissingSourcesOrTargets = false;

    public AbstractWizardVisualPanel1(AbstractImporterSpreadsheet importer) {
        this.importer = importer;
    }

    public void refreshPreviewTable() {<FILL_FUNCTION_BODY>}

    protected abstract JTable getPreviewTable();

    protected abstract JScrollPane getPreviewTableScrollPane();

    protected abstract SpreadsheetGeneralConfiguration.Mode getSelectedMode();

}

        try (SheetParser parser = importer.createParser()) {
            Map<String, Integer> headerMap = parser.getHeaderMap();
            final String[] headers = headerMap.keySet().toArray(new String[0]);

            columnCount = headers.length;

            hasSourceNodeColumn = false;
            hasTargetNodeColumn = false;
            int sourceColumnIndex = 0;
            int targetColumnIndex = 0;

            for (String header : headers) {
                if (header.equalsIgnoreCase("source")) {
                    hasSourceNodeColumn = true;
                    sourceColumnIndex = headerMap.get(header);
                }
                if (header.equalsIgnoreCase("target")) {
                    hasTargetNodeColumn = true;
                    targetColumnIndex = headerMap.get(header);
                }
            }

            ArrayList<String[]> records = new ArrayList<>();
            hasRowsMissingSourcesOrTargets = false;
            final SpreadsheetGeneralConfiguration.Mode mode = getSelectedMode();
            int maxRowSize = 0;
            String[] currentRecord;

            Iterator<SheetRow> iterator = parser.iterator();

            int count = 0;
            while (iterator.hasNext() && count < MAX_ROWS_PREVIEW) {
                count++;

                final SheetRow row = iterator.next();
                final int rowSize = row.size();

                maxRowSize = Math.max(maxRowSize, row.size());

                currentRecord = new String[rowSize];
                for (int i = 0; i < rowSize; i++) {
                    currentRecord[i] = row.get(i);
                }

                // Search for missing source or target columns for edges table
                if (mode == SpreadsheetGeneralConfiguration.Mode.EDGES_TABLE) {
                    if (rowSize <= sourceColumnIndex || rowSize <= targetColumnIndex ||
                        currentRecord[sourceColumnIndex] == null || currentRecord[targetColumnIndex] == null) {
                        hasRowsMissingSourcesOrTargets = true;
                    }
                }

                records.add(currentRecord);
            }

            final String[] columnNames = headers;
            final String[][] values = records.toArray(new String[0][]);
            final int rowSize = maxRowSize;

            final JTable table = getPreviewTable();
            table.setModel(new TableModel() {

                @Override
                public int getRowCount() {
                    return values.length;
                }

                @Override
                public int getColumnCount() {
                    return rowSize;
                }

                @Override
                public String getColumnName(int columnIndex) {
                    if (columnIndex > columnNames.length - 1) {
                        return null;
                    }
                    return columnNames[columnIndex];
                }

                @Override
                public Class<?> getColumnClass(int columnIndex) {
                    return String.class;
                }

                @Override
                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return false;
                }

                @Override
                public Object getValueAt(int rowIndex, int columnIndex) {
                    if (values[rowIndex].length > columnIndex) {
                        return values[rowIndex][columnIndex];
                    } else {
                        return null;
                    }
                }

                @Override
                public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
                }

                @Override
                public void addTableModelListener(TableModelListener l) {
                }

                @Override
                public void removeTableModelListener(TableModelListener l) {
                }
            });

            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    boolean needsHeader = headers.length > 0;
                    getPreviewTableScrollPane().setColumnHeaderView(needsHeader ? table.getTableHeader() : null);
                }
            });
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    
<methods>public void <init>() ,public void <init>(java.awt.LayoutManager) ,public void <init>(boolean) ,public void <init>(java.awt.LayoutManager, boolean) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.plaf.PanelUI getUI() ,public java.lang.String getUIClassID() ,public void setUI(javax.swing.plaf.PanelUI) ,public void updateUI() <variables>private static final java.lang.String uiClassID