Java Code Examples for org.jdesktop.swingx.JXTable

The following examples show how to use org.jdesktop.swingx.JXTable. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cuba   Source File: DesktopRowsCount.java    License: Apache License 2.0 6 votes vote down vote up
private void onNextClick() {
    if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
        return;
    }

    CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
    int firstResult = ds.getFirstResult();
    ds.setFirstResult(ds.getFirstResult() + ds.getMaxResults());
    if (refreshDatasource(ds)) {
        if (state == State.LAST && size == 0) {
            ds.setFirstResult(firstResult);
            int maxResults = ds.getMaxResults();
            ds.setMaxResults(maxResults + 1);
            refreshDatasource(ds);
            ds.setMaxResults(maxResults);
        }
        if (owner instanceof DesktopAbstractTable) {
            JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
            table.scrollRowToVisible(0);
        }
    } else {
        ds.setFirstResult(firstResult);
    }
}
 
Example 2
Source Project: cuba   Source File: DesktopRowsCount.java    License: Apache License 2.0 6 votes vote down vote up
private void onPrevClick() {
    if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
        return;
    }

    CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
    int firstResult = ds.getFirstResult();
    int newStart = ds.getFirstResult() - ds.getMaxResults();
    ds.setFirstResult(newStart < 0 ? 0 : newStart);
    if (refreshDatasource(ds)) {
        if (owner instanceof DesktopAbstractTable) {
            JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
            table.scrollRowToVisible(0);
        }
    } else {
        ds.setFirstResult(firstResult);
    }
}
 
Example 3
Source Project: cuba   Source File: DesktopRowsCount.java    License: Apache License 2.0 6 votes vote down vote up
protected void onFirstClick() {
    if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
        return;
    }

    CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
    int firstResult = ds.getFirstResult();
    ds.setFirstResult(0);
    if (refreshDatasource(ds)) {
        if (owner instanceof DesktopAbstractTable) {
            JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
            table.scrollRowToVisible(0);
        }
    } else {
        ds.setFirstResult(firstResult);
    }
}
 
Example 4
Source Project: cuba   Source File: DesktopRowsCount.java    License: Apache License 2.0 6 votes vote down vote up
protected void onLastClick() {
    if (!(datasource instanceof CollectionDatasource.SupportsPaging)) {
        return;
    }

    CollectionDatasource.SupportsPaging ds = (CollectionDatasource.SupportsPaging) datasource;
    int count = ((CollectionDatasource.SupportsPaging) datasource).getCount();
    int itemsToDisplay = count % ds.getMaxResults();
    if (itemsToDisplay == 0) itemsToDisplay = ds.getMaxResults();

    int firstResult = ds.getFirstResult();
    ds.setFirstResult(count - itemsToDisplay);
    if (refreshDatasource(ds)) {
        if (owner instanceof DesktopAbstractTable) {
            JXTable table = (JXTable) ((DesktopAbstractTable) owner).getComponent();
            table.scrollRowToVisible(0);
        }
    } else {
        ds.setFirstResult(firstResult);
    }
}
 
Example 5
public CardsDeckCheckerPanel() {
	setLayout(new BorderLayout(0, 0));
	buzyLabel = AbstractBuzyIndicatorComponent.createLabelComponent();
	JPanel panel = new JPanel();
	manager = new MTGDeckManager();
	model = new DeckSelectionTableModel();
	table = new JXTable(model);
	
	
	table.getColumnModel().getColumn(1).setCellRenderer(new ManaCellRenderer());

	
	add(panel, BorderLayout.NORTH);
	panel.add(buzyLabel);
	add(new JScrollPane(table), BorderLayout.CENTER);

	addComponentListener(new ComponentAdapter() {
		@Override
		public void componentShown(ComponentEvent componentEvent) {
			init();
		}
	});
}
 
Example 6
Source Project: BART   Source File: ImportPanel.java    License: MIT License 6 votes vote down vote up
private void initJTableFiles()   {
    jTableFiles = new JXTable();
    jTableFilesTableModel = new DBMSImportTableModel(jTableFiles);
    jTableFiles.setColumnControlVisible(true);
    jTableFiles.setEditable(false);
    jTableFiles.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jTableFiles.setModel(jTableFilesTableModel);
    jTableFiles.setShowGrid(true);
    jTableFiles.setDragEnabled(false); 
    jTableFiles.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            if(jTableFiles.getSelectedRow() < 0)   {
                delFileButton.setEnabled(false);
            }else{
                delFileButton.setEnabled(true);
            }
        }
    });
    scrollPaneFiles.setViewportView(jTableFiles);   
}
 
Example 7
Source Project: otroslogviewer   Source File: ShowCallHierarchyAction.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void action(ActionEvent e, CallHierarchyLogFilter filter, LogData... selectedLogData) throws Exception {
  Optional<JXTable> maybeTable = getOtrosApplication().getSelectPaneJXTable();
  Optional<LogDataTableModel> dataT2ableModel = getOtrosApplication().getSelectedPaneLogDataTableModel();
  maybeTable.ifPresent(jTable -> dataT2ableModel.ifPresent(dataTableModel -> {
    int selected = jTable.getSelectedRow();
    selected = jTable.convertRowIndexToModel(selected);
    ArrayList<Integer> listOfEvents2 = new ArrayList<>();
    HashSet<Integer> listEntryEvents = new HashSet<>();


    try {
      findCallHierarchyEvents(selected, dataTableModel, listEntryEvents, listOfEvents2);
    } catch (NoSuchElementException e1) {
      LOGGER.error("Log file do not have consistent Entry/Return in logs");
      getOtrosApplication().getStatusObserver().updateStatus("Log file does not have consistent Entry/Return in logs", StatusObserver.LEVEL_ERROR);
    }
    filter.setListId(listEntryEvents, listOfEvents2);
    filterEnableCheckBox.setSelected(true);
    filter.setEnable(true);
  }));
}
 
Example 8
Source Project: otroslogviewer   Source File: MarkRowAction.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void actionPerformedHook(ActionEvent e) {
  Optional<LogDataTableModel> maybeModel = getOtrosApplication().getSelectedPaneLogDataTableModel();
  Optional<JXTable> maybeTable = getOtrosApplication().getSelectPaneJXTable();
  maybeTable.ifPresent(table -> maybeModel.ifPresent(model -> {
    StatusObserver observer = getOtrosApplication().getStatusObserver();
    if (model == null || table == null) {
      return;
    }
    int[] selected = table.getSelectedRows();
    for (int i = 0; i < selected.length; i++) {
      selected[i] = table.convertRowIndexToModel(selected[i]);
    }
    model.markRows(getOtrosApplication().getSelectedMarkColors(), selected);
    if (observer != null) {
      observer.updateStatus(selected.length + " rows marked");
    }
  }));
}
 
Example 9
Source Project: otroslogviewer   Source File: MarkRowBySpaceKeyListener.java    License: Apache License 2.0 6 votes vote down vote up
private void markUnmarkRow() {
  Optional<LogDataTableModel> maybeDataTableModel = otrosApplication.getSelectedPaneLogDataTableModel();
  Optional<JXTable> maybeTable = otrosApplication.getSelectPaneJXTable();

  maybeTable.ifPresent(table -> maybeDataTableModel.ifPresent(dataTableModel -> {
      int[] selected = table.getSelectedRows();
      if (selected.length == 0) {
        return;
      }
      boolean modeMark = !dataTableModel.isMarked(selected[0]);

      if (modeMark) {
        dataTableModel.markRows(otrosApplication.getSelectedMarkColors(), selected);
      } else {
        dataTableModel.unmarkRows(selected);
      }
    }
  ));


}
 
Example 10
Source Project: otroslogviewer   Source File: FocusOnThisAbstractAction.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void actionPerformedHook(ActionEvent e) {
  Optional<JXTable> maybeTable = getOtrosApplication().getSelectPaneJXTable();

  final Optional<LogDataTableModel> maybeTableModel = getOtrosApplication().getSelectedPaneLogDataTableModel();
  maybeTable.ifPresent(jxTable -> maybeTableModel.ifPresent(tableModel -> {
    int[] selectedRows = jxTable.getSelectedRows();
    if (selectedRows.length <= 0) {
      return;
    }

    LogData[] selectedLogData = new LogData[selectedRows.length];
    for (int i = 0; i < selectedRows.length; i++) {
      selectedLogData[i] = tableModel.getLogData(jxTable.convertRowIndexToModel(selectedRows[i]));
    }
    try {
      action(e, filter, selectedLogData);
      filterEnableCheckBox.setSelected(true);
      filter.setEnable(true);
    } catch (Exception e1) {
      LOGGER.error("Error occurred when focusing on events ", e1);
      JOptionPane.showMessageDialog(getOtrosApplication().getApplicationJFrame(), e1.getLocalizedMessage(), "Error", JOptionPane.ERROR_MESSAGE);
    }
  }));
}
 
Example 11
Source Project: otroslogviewer   Source File: UnMarkRowAction.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void actionPerformedHook(ActionEvent e) {
  Optional<JXTable> maybeTable = getOtrosApplication().getSelectPaneJXTable();
  Optional<LogDataTableModel> maybeModel = getOtrosApplication().getSelectedPaneLogDataTableModel();

  maybeTable.ifPresent(table -> maybeModel.ifPresent(model -> {
    StatusObserver observer = getOtrosApplication().getStatusObserver();
    int[] selected = table.getSelectedRows();
    for (int i = 0; i < selected.length; i++) {
      selected[i] = table.convertRowIndexToModel(selected[i]);
    }
    model.unmarkRows(selected);
    if (observer != null) {
      observer.updateStatus(selected.length + " rows unmarked");
    }
  }));
}
 
Example 12
public void initGUI() {

	JPanel panneauHaut = new JPanel();
	getContentPane().add(panneauHaut, BorderLayout.NORTH);

	try {
	cboField = UITools.createCombobox(MTGControler.getInstance().getEnabled(MTGCardsIndexer.class).listFields());
	}
	catch(Exception e)
	{
		cboField.addItem("NO INDEXER FILE FOUND");
	}
	
	panneauHaut.add(cboField);
	indexModel = new MapTableModel<>();
	indexModel.setColumnNameAt(0, "Term");
	indexModel.setColumnNameAt(1, "Occurences");
	JXTable table = new JXTable(indexModel);
	
	getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
	
	cboField.addItemListener(ie -> {
		if (ie.getStateChange() == ItemEvent.SELECTED) {
			init();
		}
	});

	if (getProperties().size() > 0) {
		Rectangle r = new Rectangle((int) Double.parseDouble(getString("x")),
				(int) Double.parseDouble(getString("y")), (int) Double.parseDouble(getString("w")),
				(int) Double.parseDouble(getString("h")));

		setBounds(r);
	}

}
 
Example 13
@Override
public void initGUI() 
{
	getContentPane().setLayout(new BorderLayout(0, 0));
	model=new GenericTableModel<>();
	JPanel panneauHaut = new JPanel();
	getContentPane().add(panneauHaut, BorderLayout.NORTH);
	comboBox = UITools.createCombobox(INSIGHT_SELECTION.values());
	panneauHaut.add(comboBox);
	service = new InsightService();
	JXTable table = new JXTable(model);
	getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
	comboBox.addItemListener(pcl->{
	
		if (pcl.getStateChange() == ItemEvent.SELECTED) {
			init();
		}
	});
	
	
	if (getProperties().size() > 0) {
		Rectangle r = new Rectangle((int) Double.parseDouble(getString("x")),
				(int) Double.parseDouble(getString("y")), (int) Double.parseDouble(getString("w")),
				(int) Double.parseDouble(getString("h")));
		setBounds(r);
		
		if(getString(INSIGHT_SELECTION_KEY)!=null)
				comboBox.setSelectedItem(INSIGHT_SELECTION.valueOf(getString(INSIGHT_SELECTION_KEY)));
	}
	
}
 
Example 14
@Override
public void initGUI() {
	JScrollPane scrollPane = new JScrollPane();
	getContentPane().add(scrollPane, BorderLayout.CENTER);
	model = new CardAlertTableModel();
	JXTable table = new JXTable(model);
	scrollPane.setViewportView(table);

	HistoryPricesPanel historyPricesPanel = new HistoryPricesPanel(false);
	historyPricesPanel.setPreferredSize(new Dimension(119, 200));
	getContentPane().add(historyPricesPanel, BorderLayout.SOUTH);
	table.getColumnModel().getColumn(4).setCellRenderer(new CardShakeRenderer());
	table.getColumnModel().getColumn(5).setCellRenderer(new CardShakeRenderer());
	table.getColumnModel().getColumn(1).setCellRenderer(new MagicEditionsComboBoxCellRenderer(false));
	
	table.getSelectionModel().addListSelectionListener(event -> {
		if (!event.getValueIsAdjusting()) {
			ThreadManager.getInstance().invokeLater(() -> {
				int row = table.getSelectedRow();
				MagicCardAlert alt = (MagicCardAlert) table.getValueAt(row, 0);
				historyPricesPanel.init(alt.getCard(), alt.getCard().getCurrentSet(),alt.getCard().toString());
				historyPricesPanel.revalidate();
			});

		}
	});

	if (getProperties().size() > 0) {
		Rectangle r = new Rectangle((int) Double.parseDouble(getString("x")),
				(int) Double.parseDouble(getString("y")), (int) Double.parseDouble(getString("w")),
				(int) Double.parseDouble(getString("h")));
		setBounds(r);
	}

	table.packAll();

}
 
Example 15
private void initGUI() {
	setLayout(new BorderLayout(0, 0));
	calc = new MTGDeckManager();
	table = new JXTable();
	
	
	add(new JScrollPane(table), BorderLayout.CENTER);
	JPanel panel = new JPanel();
	panel.setBackground(Color.WHITE);
	add(panel, BorderLayout.NORTH);

	JLabel lblDrawProbability = new JLabel(MTGControler.getInstance().getLangService().getCapitalize("DRAW_PROBABILITIES"));
	lblDrawProbability.setFont(MTGControler.getInstance().getFont().deriveFont(Font.BOLD, 14));
	panel.add(lblDrawProbability);
}
 
Example 16
public SimilarityCardPanel() {
	setLayout(new BorderLayout(0, 0));
	
	model = new SimilarityCardsTableModel();
	tableSimilarity = new JXTable(model);
	
	add(new JScrollPane(tableSimilarity), BorderLayout.CENTER);
	
	addComponentListener(new ComponentAdapter() {
		@Override
		public void componentShown(ComponentEvent componentEvent) {
			init(currentCard);
		}
	});
}
 
Example 17
Source Project: zap-extensions   Source File: TokenGenMessagesTable.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected int getRowCount(final JXTable table) {
    final int rowCount = super.getRowCount(table);
    if (rowCount > MAX_CONFIG_ROW_COUNT) {
        return MAX_CONFIG_ROW_COUNT;
    }
    return rowCount;
}
 
Example 18
Source Project: dsworkbench   Source File: UIHelper.java    License: Apache License 2.0 5 votes vote down vote up
public static void initTableColums(JXTable table, int width, String... headers) {
    for (String caption : headers) {
        TableColumnExt columns = table.getColumnExt(caption);
        columns.setPreferredWidth(width);
        columns.setMaxWidth(width);
        columns.setWidth(width);
    }
}
 
Example 19
Source Project: dsworkbench   Source File: PropertyHelper.java    License: Apache License 2.0 5 votes vote down vote up
public static void storeTableProperties(JXTable pTable, Configuration pConfig, String pPrefix) {
  List<TableColumn> cols = ((TableColumnModelExt) pTable.getColumnModel()).getColumns(true);

  for (TableColumn c : cols) {
    TableColumnExt col = (TableColumnExt) c;
    String title = col.getTitle();
    pConfig.setProperty(pPrefix + ".table.col." + title + ".width", col.getWidth());
    pConfig.setProperty(pPrefix + ".table.col." + title + ".visible", col.isVisible());
  }
  int sortedCol = pTable.getSortedColumnIndex();
  if (sortedCol < 0) {
    return;
  }
  pConfig.setProperty(pPrefix + ".table.sort.col", sortedCol);
  int sortOrder = 0;
  switch (pTable.getSortOrder(sortedCol)) {
    case ASCENDING:
      sortOrder = 1;
      break;
    case DESCENDING:
      sortOrder = -1;
      break;
    default:
      sortOrder = 0;
  }
  pConfig.setProperty(pPrefix + ".table.sort.order", sortOrder);
  pConfig.setProperty(pPrefix + ".table.horizontal.scroll", pTable.isHorizontalScrollEnabled());
}
 
Example 20
Source Project: BART   Source File: TableDataView.java    License: MIT License 5 votes vote down vote up
private void initJTable()   {
    valueTable = new JXTable();
    valueTable.setColumnControlVisible(true);
    valueTable.setEditable(false);
    valueTable.setDefaultRenderer(Object.class, new TableValueCellRender());
    valueTable.setCellSelectionEnabled(true);
    valueTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    valueTable.setModel(dataModel);
    valueTable.setShowGrid(true);
    valueTable.setDragEnabled(false); 
    valueTable.setSelectionBackground(new Color(214, 217, 223));
    valueTable.setVisibleRowCount(20);
    pageCtrlPanel.setVisibleRow(20+"");
}
 
Example 21
Source Project: BART   Source File: RelativePainterHighlighter.java    License: MIT License 5 votes vote down vote up
private int getColumnLocation(ComponentAdapter adapter, int visualColumn) { 
    if (!(adapter.getComponent() instanceof JXTable)) { 
        return 0; 
    } 
    JXTable table = (JXTable) adapter.getComponent(); 
    // PENDING JW: guard against null header 
    return table.getTableHeader().getHeaderRect(visualColumn).x; 
}
 
Example 22
Source Project: BART   Source File: RelativePainterHighlighter.java    License: MIT License 5 votes vote down vote up
private int getColumnWidth(ComponentAdapter adapter, int visualColumn) { 
    if (!(adapter.getComponent() instanceof JXTable)) { 
        return adapter.getComponent().getWidth(); 
    } 
    JXTable table = (JXTable) adapter.getComponent(); 
    return table.getColumn(visualColumn).getWidth(); 
}
 
Example 23
Source Project: BART   Source File: RelativePainterHighlighter.java    License: MIT License 5 votes vote down vote up
private int getColumnAt(ComponentAdapter adapter, int pixelLocation) { 
    if (!(adapter.getComponent() instanceof JXTable)) { 
        return 0; 
    } 
    JXTable table = (JXTable) adapter.getComponent(); 
    // PENDING JW: guard against null header 
    return table.getTableHeader().columnAtPoint( 
            new Point(pixelLocation, 10)); 
}
 
Example 24
Source Project: BART   Source File: VioGenQueriesWPanel.java    License: MIT License 5 votes vote down vote up
private void initTable()   {
    table = new JXTable();
    table.setColumnControlVisible(true);
    table.setEditable(true);
    table.setCellSelectionEnabled(true);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setShowGrid(true);
    table.setDragEnabled(false); 
    table.setSelectionBackground(new Color(214, 217, 223));
    highlighterControl = new HighlighterControl();
}
 
Example 25
Source Project: BART   Source File: ChartTopComponent.java    License: MIT License 5 votes vote down vote up
private void initTable()   {
    cellChangesTable = new JXTable();
    cellChangesTable.setEditable(false);
    cellChangesTable.setColumnControlVisible(true);
    cellChangesTable.setShowGrid(true);
    cellChangesTable.setDragEnabled(false); 
    cellChangesTable.setSelectionBackground(new Color(214, 217, 223));
    cellChangesTable.setModel(model);
}
 
Example 26
public Example_7a_View() {
    super();
    setTitle(getClass().getSimpleName() + " " + ManagementFactory.getRuntimeMXBean().getName());

    setBounds(100, 100, 700, 500);
    setDefaultCloseOperation(StrictThreadingJFrame.EXIT_ON_CLOSE);
    getContentPane().setLayout(new BorderLayout(0, 0));

    final JXTable table = new JXTable(myTableModel);
    table.setHighlighters(HighlighterFactory.createSimpleStriping());
    table.setSortable(false);
    table.getTableHeader().setReorderingAllowed(false);

    myTableModel.addTableModelListener(new TableModelListener() {

        int lastRowCountScrolledTo = -1;

        @Override
        public void tableChanged(final TableModelEvent e) {
            if (TableUtilities.isInsert(e)) {
                final int currentRowCount = myTableModel.getRowCount();
                if (currentRowCount != lastRowCountScrolledTo) {
                    lastRowCountScrolledTo = currentRowCount;
                    SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false)));
                }
            }
        }
    });

    JScrollPane scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
}
 
Example 27
public Example_7_View() {
    super();
    setTitle(getClass().getSimpleName() + " " + ManagementFactory.getRuntimeMXBean().getName());

    setBounds(100, 100, 700, 500);
    setDefaultCloseOperation(StrictThreadingJFrame.EXIT_ON_CLOSE);
    getContentPane().setLayout(new BorderLayout(0, 0));

    final JXTable table = new JXTable(myTableModel);
    table.setHighlighters(HighlighterFactory.createSimpleStriping());
    table.setSortable(false);
    table.getTableHeader().setReorderingAllowed(false);

    myTableModel.addTableModelListener(new TableModelListener() {

        int lastRowCountScrolledTo = -1;

        @Override
        public void tableChanged(final TableModelEvent e) {
            if (TableUtilities.isInsert(e)) {
                final int currentRowCount = myTableModel.getRowCount();
                if (currentRowCount != lastRowCountScrolledTo) {
                    lastRowCountScrolledTo = currentRowCount;
                    SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false)));
                }
            }
        }
    });

    JScrollPane scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
}
 
Example 28
public Example_8_View() {
    super();
    setTitle(getClass().getSimpleName() + " " + ManagementFactory.getRuntimeMXBean().getName());

    setBounds(100, 100, 700, 500);
    setDefaultCloseOperation(StrictThreadingJFrame.EXIT_ON_CLOSE);
    getContentPane().setLayout(new BorderLayout(0, 0));

    final JXTable table = new JXTable(myTableModel);
    table.setHighlighters(HighlighterFactory.createSimpleStriping());
    table.setSortable(false);
    table.getTableHeader().setReorderingAllowed(false);

    myTableModel.addTableModelListener(new TableModelListener() {

        int lastRowCountScrolledTo = -1;

        @Override
        public void tableChanged(final TableModelEvent e) {
            if (TableUtilities.isInsert(e)) {
                final int currentRowCount = myTableModel.getRowCount();
                if (currentRowCount != lastRowCountScrolledTo) {
                    lastRowCountScrolledTo = currentRowCount;
                    SwingUtilities.invokeLater(() -> table.scrollRectToVisible(table.getCellRect(myTableModel.getRowCount() - 1, 0, false)));
                }
            }
        }
    });

    JScrollPane scrollPane = new JScrollPane(table);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
}
 
Example 29
JComponent createTaskExportFieldsPanel(TableModel tableModel, String id) {
  JXTable table = new JXTable(tableModel);
  table.setTableHeader(null);
  table.setVisibleRowCount(10);
  JScrollPane scrollPane = new JScrollPane(table);

  JPanel panel = new JPanel(new BorderLayout());
  panel.add(BorderLayout.CENTER, scrollPane);
  UIUtil.createTitle(panel, language.getText(id));
  return panel;
}
 
Example 30
Source Project: nextreports-designer   Source File: ParametersPanel.java    License: Apache License 2.0 5 votes vote down vote up
private void createTable() {
	model = new ParametersTableModel();
	table = new JXTable(model);
       table.setSortable(false);
       //table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       table.setRolloverEnabled(true);
       table.addHighlighter(new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, null, Color.RED)); 
}