List of utility methods to do JTable Scroll
void | scrollToVisible(JTable table, int rowIndex, int vColIndex) Scroll to the given row in a table. if (!(table.getParent() instanceof JViewport)) return; JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); table.scrollRectToVisible(rect); viewport.scrollRectToVisible(rect); ... |
void | scrollToVisible(JTable table, int rowIndex, int vColIndex) scroll To Visible if (!(table.getParent() instanceof JViewport)) { return; JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); viewport.scrollRectToVisible(rect); ... |
void | scrollToVisible(JTable table, int rowIndex, int vColIndex) Scrolls a table so that a certain cell becomes visible. if (!(table.getParent() instanceof JViewport)) { return; JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); table.scrollRectToVisible(rect); ... |
void | scrollToVisible(JTable table, int rowIndex, int vColIndex) scroll To Visible if (!(table.getParent() instanceof JViewport)) { return; JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); viewport.scrollRectToVisible(rect); ... |
void | scrollToVisible(JTable table, int rowIndex, int vColIndex) Scroluje na radek a slopec tabulky if (!(table.getParent() instanceof JViewport)) { return; JViewport viewport = (JViewport) table.getParent(); Rectangle rect = table.getCellRect(rowIndex, vColIndex, true); Point pt = viewport.getViewPosition(); rect.setLocation(rect.x - pt.x, rect.y - pt.y); table.scrollRectToVisible(rect); ... |
void | selectAndScroll(JTable table, int rowIndex) select And Scroll table.getSelectionModel().setSelectionInterval(rowIndex, rowIndex); scrollToVisible(table, rowIndex); |
void | selectAndScrollToPosition(JTable table, int index0, int index1) select And Scroll To Position selectPositions(table, index0, index1); scrollToPosition(table, index0); |
void | selectRow(int row, JTable table, JScrollPane pane) Selects a the specified row in the specified JTable and scrolls the specified JScrollpane to the newly selected row. if (table == null || pane == null) { return; if (contains(row, table.getModel()) == false) { return; moveAdjustable(row * table.getRowHeight(), pane.getVerticalScrollBar()); selectRow(row, table.getSelectionModel()); ... |
void | selectRow(JTable table, int row, boolean bScroll) select Row assert (row >= 0 && row < table.getRowCount()); if (row >= 0 && row < table.getRowCount()) { table.setRowSelectionInterval(row, row); if (bScroll) { Rectangle rect = table.getCellRect(row, 0, true); table.scrollRectToVisible(rect); |
void | showMessageDialogInScrollableUneditableTextArea(java.awt.Component owner, String text, String title, int messageType, final int maxPreferredWidth, final int maxPreferredHeight) show Message Dialog In Scrollable Uneditable Text Area assert (messageType == javax.swing.JOptionPane.ERROR_MESSAGE) || (messageType == javax.swing.JOptionPane.INFORMATION_MESSAGE) || (messageType == javax.swing.JOptionPane.WARNING_MESSAGE) || (messageType == javax.swing.JOptionPane.PLAIN_MESSAGE); javax.swing.JTextArea textArea = new javax.swing.JTextArea(text); textArea.setEditable(false); javax.swing.JOptionPane.showMessageDialog(owner, new javax.swing.JScrollPane(textArea) { @Override ... |