protected void adjustTableUI() { logTable.setFocusable(false); logTable.setRowHeight(18); logTable.getTableHeader().setReorderingAllowed(false); logTable.setBorder(BorderFactory.createEmptyBorder()); logTable.getColumnModel().getColumn(0).setMinWidth(30); logTable.getColumnModel().getColumn(0).setMaxWidth(30); logTable.getColumnModel().getColumn(0).setResizable(false); logTable.getColumnModel().getColumn(1).setMinWidth(90); logTable.getColumnModel().getColumn(1).setMaxWidth(90); logTable.getColumnModel().getColumn(1).setResizable(false); logTable.getColumnModel().getColumn(2).setMinWidth(110); logTable.getColumnModel().getColumn(2).setMaxWidth(250); logTable.getColumnModel().getColumn(3).setPreferredWidth(150); logTable.getColumnModel().getColumn(3).setMaxWidth(400); logTable.getColumnModel().getColumn(4).setPreferredWidth(600); }
table = new JTable(propertiesModel); table.setShowGrid(true); table.setBorder(null); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); JScrollPane tableScroll = new JScrollPane(table);
protected void adjustTableUI() { logTable.setFocusable(false); logTable.setRowHeight(18); logTable.getTableHeader().setReorderingAllowed(false); logTable.setBorder(BorderFactory.createEmptyBorder()); logTable.getColumnModel().getColumn(0).setMinWidth(30); logTable.getColumnModel().getColumn(0).setMaxWidth(30); logTable.getColumnModel().getColumn(0).setResizable(false); logTable.getColumnModel().getColumn(1).setMinWidth(90); logTable.getColumnModel().getColumn(1).setMaxWidth(90); logTable.getColumnModel().getColumn(1).setResizable(false); logTable.getColumnModel().getColumn(2).setMinWidth(110); logTable.getColumnModel().getColumn(2).setMaxWidth(250); logTable.getColumnModel().getColumn(3).setPreferredWidth(150); logTable.getColumnModel().getColumn(3).setMaxWidth(400); logTable.getColumnModel().getColumn(4).setPreferredWidth(600); }
protected void adjustTableUI() { logTable.setFocusable(false); logTable.setRowHeight(18); logTable.getTableHeader().setReorderingAllowed(false); logTable.setBorder(BorderFactory.createEmptyBorder()); logTable.getColumnModel().getColumn(0).setMinWidth(30); logTable.getColumnModel().getColumn(0).setMaxWidth(30); logTable.getColumnModel().getColumn(0).setResizable(false); logTable.getColumnModel().getColumn(1).setMinWidth(90); logTable.getColumnModel().getColumn(1).setMaxWidth(90); logTable.getColumnModel().getColumn(1).setResizable(false); logTable.getColumnModel().getColumn(2).setMinWidth(100); logTable.getColumnModel().getColumn(2).setMaxWidth(250); logTable.getColumnModel().getColumn(3).setPreferredWidth(150); logTable.getColumnModel().getColumn(3).setMaxWidth(400); logTable.getColumnModel().getColumn(4).setPreferredWidth(600); }
handlerTable.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); handlerTable.setModel(handlerTableModel); jScrollPane2.setViewportView(handlerTable);
@Override public void hierarchyChanged(HierarchyEvent e) { if (HierarchyEvent.HIERARCHY_CHANGED == e.getID() && (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) { // The scroll bar has changed state if (e.getComponent().isShowing()) { // Draw a border to the right of the table table.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, Themes.currentTheme.text())); } else { // Remove the table border to avoid a thick black line on the right table.setBorder(BorderFactory.createEmptyBorder()); } } } });
public ImportShapeSummaryPanel(){ this.setLayout(new MigLayout("wrap 1")); JLabel summaryText = new JLabel(Bundle.ImportShapeSummaryPanel_summary_text()); this.add(summaryText); tableModel = new DefaultTableModel(); importedtable = new JTable(tableModel); importedtable.setBorder(new EmptyBorder(0,0,0,0)); importedtable.setBackground(Color.white); JScrollPane importedTableScrolPane = new JScrollPane(importedtable); importedTableScrolPane.setBackground(Color.white); importedTableScrolPane.setBorder(new EmptyBorder(0, 0, 0, 0)); importedTableScrolPane.getViewport().setBackground(Color.white); this.add(importedTableScrolPane); }
table.setBorder(null); table.setGridColor(new Color(235, 235, 235)); table.setRowHeight(21);
private void handleTableShown(){ Thread t = new Thread(() -> { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(new Color(220, 220, 220)); table.setShowVerticalLines(false); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 1); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); }, "Load plugin table contents"); t.start(); }
list.setBorder(null); list.setShowGrid(false); list.setRowHeight(21);
public void run() { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(Color.LIGHT_GRAY); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 3); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); } }, "Load plugin table contents");
public void run() { tableModel = new PluginUpdateTableModel(provider); table = new JTable(tableModel); table.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); table.setShowGrid(true); table.setRowMargin(1); table.setGridColor(Color.LIGHT_GRAY); table.setRowHeight(table.getRowHeight() + 5); table.setRowSelectionAllowed(true); table.setColumnSelectionAllowed(false); TableUtils.pack(table, true, false, 3); final JScrollPane tableSp = new JScrollPane(table); for (ListSelectionListener l : pendingListeners){ table.getSelectionModel().addListSelectionListener(l); } pendingListeners.clear(); SwingUtilities.invokeLater(new Runnable(){ public void run() { remove(waitLabel); add(tableSp, BorderLayout.CENTER); validate(); } }); } }, "Load plugin table contents");
private void createTableTotal() { DataTableStyling.applyColors(list.tableTotal); list.tableTotal.setBorder(new MatteBorder(1, 0, 0, 0, DataTableStyling.COLOR_ALTERNATING_HILITE)); modelTotal = new AbstractTableModel() { @Override public Object getValueAt(int rowIndex, int columnIndex) { return TotalsTableColumn.get(columnIndex).getValue(rowIndex); } @Override public int getColumnCount() { return TotalsTableColumn.values().length; } @Override public Class<?> getColumnClass(int columnIndex) { return TotalsTableColumn.get(columnIndex).clazz; } @Override public int getRowCount() { return 3; } }; list.tableTotal.setModel(modelTotal); TableColumnModel colModel = list.tableTotal.getColumnModel(); for (TotalsTableColumn col : TotalsTableColumn.values()) { TableColumn tCol = colModel.getColumn(col.index); tCol.setCellRenderer(new CustomRenderer(null, col.renderer)); tCol.setMinWidth(0); } }
public DCTablePanel(final JTable table, final boolean scrolleable) { _table = table; setLayout(new BorderLayout()); final JTableHeader tableHeader = table.getTableHeader(); add(tableHeader, BorderLayout.NORTH); tableHeader.setBorder(WidgetUtils.BORDER_TABLE_PANEL); table.setBorder(WidgetUtils.BORDER_TABLE_PANEL); if (scrolleable) { _scrollPane = WidgetUtils.scrolleable(table); add(_scrollPane, BorderLayout.CENTER); } else { _scrollPane = null; add(table, BorderLayout.CENTER); } }
table.setBorder(new LineBorder(table.getGridColor()));
@Override public void installUI (JComponent c) { super.installUI (c); JTable table = (JTable) c; table.setOpaque (false); table.setSelectionForeground (UIManager.getColor ("Table.selectionForeground")); table.setBackground (UIManager.getColor ("Table.background")); table.setFont (UIManager.getFont ("Table.font")); table.setBorder (UIManager.getBorder ("Table.border")); table.setGridColor (UIManager.getColor ("Table.gridColor")); table.setSelectionBackground (UIManager.getColor ("Table.selectionBackground")); table.getTableHeader ().setResizingAllowed (true); int rowHeight = UIManager.getInt ("Table.rowHeight"); if (rowHeight > 0) { table.setRowHeight (rowHeight); } else { table.setRowHeight (table.getRowHeight () + 25); } table.setDefaultRenderer (Object.class, new MaterialTableCellRenderer ()); table.setDefaultEditor (Object.class, new MaterialTableCellEditor ()); }
/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor ("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer() .getTableCellRendererComponent(null, " ", false, false, 0, 0); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }
/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer().getTableCellRendererComponent( null, " ", false, false, 0, 0 ); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }
table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); table.setRowHeight(PATH_ROW_HEIGHT); table.setBorder(BorderFactory.createLineBorder(Color.black)); table.addFocusListener(new FocusListener() { @Override
/** initialize view */ private void initializeView() { // adjustment of controlling view Component comp = controllingView.getViewport().getView(); controllingView.setViewportView(comp); if (UIManager.getColor ("Table.background") != null) { // NOI18N getViewport().setBackground(UIManager.getColor("Table.background")); // NOI18N } // both views share one vertical scrollbar setVerticalScrollBar(controllingView.getVerticalScrollBar()); ScrollPaneLayout spl = new EnablingScrollPaneLayout(controllingView); setLayout(spl); spl.syncWithScrollPane(this); spl = new EnablingScrollPaneLayout(this); controllingView.setLayout(spl); spl.syncWithScrollPane(controllingView); table.setBorder(null); // table like header header = new JTable().getTableHeader().getDefaultRenderer() .getTableCellRendererComponent(null, " ", false, false, 0, 0); // NOI18N MouseInputListener mouseHandler = new MouseDragHandler(); header.addMouseListener(mouseHandler); header.addMouseMotionListener(mouseHandler); }