private void configureTableAppearance() { tableDevices.setOpaque(false); ((DefaultTableCellRenderer) tableDevices.getDefaultRenderer(Object.class)).setOpaque(false); tableDevices.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); tableDevices.getColumnModel().getColumn(0).setPreferredWidth(100); tableDevices.getColumnModel().getColumn(1).setMinWidth(85); tableDevices.getColumnModel().getColumn(1).setMaxWidth(85); tableDevices.getColumnModel().getColumn(2).setMinWidth(215); tableDevices.getColumnModel().getColumn(2).setMaxWidth(215); tableDevices.getColumnModel().getColumn(2).setCellRenderer(new ConnectDisconnectRenderer()); tableDevices.getColumnModel() .getColumn(2) .setCellEditor(new ConnectDisconnectEditor(new JCheckBox(), this)); }
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); }
private void setListDataFrom(List<Match> matches) { resultsTable.setModel(tableModelFrom(matches)); TableColumnModel colModel = resultsTable.getColumnModel(); TableColumn column; int width; for (int i = 0; i < matchColumns.length; i++) { if (matchColumns[i].width() > 0) { column = colModel.getColumn(i); width = matchColumns[i].width(); column.setPreferredWidth(width); column.setMinWidth(width); column.setMaxWidth(width); } } }
getColumnModel().getColumn(0).setMinWidth(50); getColumnModel().getColumn(0).setMaxWidth(50); getColumnModel().getColumn(0).setPreferredWidth(50); getColumnModel().getColumn(1).setMinWidth(50); getColumnModel().getColumn(1).setMaxWidth(50); getColumnModel().getColumn(1).setPreferredWidth(50); getColumnModel().getColumn(2).setMinWidth(60); getColumnModel().getColumn(2).setMaxWidth(150); getColumnModel().getColumn(2).setPreferredWidth(60); getColumnModel().getColumn(3).setMinWidth(60); getColumnModel().getColumn(3).setMaxWidth(60); getColumnModel().getColumn(3).setPreferredWidth(60); getColumnModel().getColumn(4).setMinWidth(60); getColumnModel().getColumn(4).setMaxWidth(60); getColumnModel().getColumn(4).setPreferredWidth(60); getColumnModel().getColumn(5).setMinWidth(80); getColumnModel().getColumn(5).setMaxWidth(150); getColumnModel().getColumn(5).setPreferredWidth(80); getColumnModel().getColumn(6).setMinWidth(60); getColumnModel().getColumn(6).setMaxWidth(60); getColumnModel().getColumn(6).setPreferredWidth(60); getColumnModel().getColumn(7).setMinWidth(50);
table.getColumnModel().getColumn(0).setMinWidth(0); table.getTableHeader().getColumnModel().getColumn(0).setMaxWidth(0); table.getTableHeader().getColumnModel().getColumn(0).setMinWidth(0);
public StateVariableTable(List<StateVariableValue> values) { this.valuesModel = new StateVariableValuesTableModel(values); setRowHeight(25); setRowSelectionAllowed(true); setColumnSelectionAllowed(false); setCellSelectionEnabled(true); setModel(valuesModel); getColumnModel().getColumn(0).setHeaderValue("State Variable"); getColumnModel().getColumn(0).setMinWidth(100); getColumnModel().getColumn(0).setMaxWidth(250); getColumnModel().getColumn(0).setPreferredWidth(200); getColumnModel().getColumn(1).setHeaderValue("Value"); setDefaultRenderer(StateVariableValue.class, new StateVariableValueCellRenderer()); }
public ActionArgumentTable(Action action, boolean isInput) { ActionArgumentValue[] argumentValues = isInput ? createDefaultValuesInput(action) : createDefaultValuesOutput(action); this.argumentValuesModel = new ActionArgumentValuesTableModel(argumentValues); setRowHeight(25); setRowSelectionAllowed(false); setColumnSelectionAllowed(false); setCellSelectionEnabled(false); setFocusable(false); registerKeyboardAction( new CellEditorNavigationAction(true), KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); registerKeyboardAction( new CellEditorNavigationAction(false), KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.SHIFT_MASK, false), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ); setModel(argumentValuesModel); getColumnModel().getColumn(0).setHeaderValue((isInput ? "IN" : "OUT") + " Argument"); getColumnModel().getColumn(0).setMinWidth(100); getColumnModel().getColumn(0).setMaxWidth(250); getColumnModel().getColumn(0).setPreferredWidth(200); getColumnModel().getColumn(1).setHeaderValue("Value"); setDefaultRenderer( ActionArgumentValue.class, new ArgumentValueCellRenderer(isInput) ); }
firstNameCol.setMinWidth(100); firstNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("firstName")); lastNameCol.setMinWidth(100); lastNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("lastName")); emailCol.setMinWidth(200); emailCol.setCellValueFactory(new PropertyValueFactory<Person, String>("email"));
firstNameCol.setMinWidth(100); firstNameCol.setCellValueFactory( new PropertyValueFactory<Person, String>("firstName")); lastNameCol.setMinWidth(100); lastNameCol.setCellValueFactory( new PropertyValueFactory<Person, String>("lastName")); emailCol.setMinWidth(200); emailCol.setCellValueFactory( new PropertyValueFactory<Person, String>("email"));
firstNameCol.setMinWidth(100); firstNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("firstName")); lastNameCol.setMinWidth(100); lastNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("lastName")); emailCol.setMinWidth(200); emailCol.setCellValueFactory(new PropertyValueFactory<Person, String>("email"));
private void setColumnWith(final JTable table, final int columnIndex, final int minSize, final int preferredSize, final Integer maxSize) { final TableColumn column = table.getColumnModel().getColumn(columnIndex); column.setMinWidth(minSize); column.setWidth(preferredSize); column.setPreferredWidth(preferredSize); if (maxSize != null) { column.setMaxWidth(maxSize); } }
public void setDeckEditorMode(DeckEditorMode mode) { if (mode == DeckEditorMode.FREE_BUILDING) { // activate spinner for card number change mainModel.setNumberEditable(true); TableColumnModel tcm = mainTable.getColumnModel(); TableColumn tc = tcm.getColumn(0); tc.setMaxWidth(55); tc.setMinWidth(55); tc.setPreferredWidth(55); tc.setCellEditor(new TableSpinnerEditor(this)); } }
table.setDefaultRenderer(Color.class, new ColorBarCellRenderer()); table.setRowHeight(40); table.getColumnModel().getColumn(0).setMinWidth(30); table.getColumnModel().getColumn(0).setMaxWidth(50); table.getColumnModel().getColumn(1).setMinWidth(100); table.getColumnModel().getColumn(1).setMaxWidth(100);
// init code vs.. TableColumn firstNameCol = new TableColumn("First Name"); firstNameCol.setMinWidth(100); firstNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("firstName")); firstNameCol.setCellFactory(getCustomCellFactory("green")); TableColumn lastNameCol = new TableColumn("Last Name"); lastNameCol.setMinWidth(100); lastNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("lastName")); lastNameCol.setCellFactory(getCustomCellFactory("red")); table.setItems(data); table.getColumns().addAll(firstNameCol, lastNameCol); // scene create code vs..
settingsTableScrollPane.setViewportView(settingsTable); settingsTable.getTableHeader().setReorderingAllowed(false); settingsTable.getColumnModel().getColumn(0).setMinWidth(60); settingsTable.getColumnModel().getColumn(0).setMaxWidth(80); settingsTable.getColumnModel().getColumn(2).setPreferredWidth(85);
tableRenderer.setModel(ptm); tableRenderer.getColumnModel().getColumn(0).setMaxWidth(100); tableRenderer.getColumnModel().getColumn(0).setMinWidth(100); return tableRenderer; } else if (value.getClass() tableRenderer.setModel(ptm); tableRenderer.getColumnModel().getColumn(0).setMaxWidth(100); tableRenderer.getColumnModel().getColumn(0).setMinWidth(100); return tableRenderer; } else if (value.getClass() == MondrianGuiDef.Formula.class) { tableRenderer.setModel(ptm); tableRenderer.getColumnModel().getColumn(0).setMaxWidth(100); tableRenderer.getColumnModel().getColumn(0).setMinWidth(100); return tableRenderer; } else if (value.getClass() tableRenderer.setModel(ptm); tableRenderer.getColumnModel().getColumn(0).setMaxWidth(100); tableRenderer.getColumnModel().getColumn(0).setMinWidth(100); return tableRenderer; } else if (value.getClass() == MondrianGuiDef.Table.class) { tableRenderer.setModel(ptm); tableRenderer.getColumnModel().getColumn(0).setMaxWidth(100); tableRenderer.getColumnModel().getColumn(0).setMinWidth(100); return tableRenderer; } else if (value.getClass()
for (int i = 0 ; i < fixedColumns ; i++) { TableColumn column = columnModel.getColumn(i); column.setMinWidth(0); column.setMaxWidth(0); this.fixedTable.getColumnModel().addColumn(new TableColumn(i));
tableEditor.setModel(ptm); tableEditor.getColumnModel().getColumn(0).setMaxWidth(100); tableEditor.getColumnModel().getColumn(0).setMinWidth(100); activeEditor = tableEditor; } else if (value.getClass() tableEditor.setModel(ptm); tableEditor.getColumnModel().getColumn(0).setMaxWidth(100); tableEditor.getColumnModel().getColumn(0).setMinWidth(100); activeEditor = tableEditor; } else if (value.getClass() == MondrianGuiDef.Table.class) { tableEditor.getColumnModel().getColumn(0).setMinWidth(100); activeEditor = tableEditor; } else if (value.getClass() == MondrianGuiDef.AggFactCount.class) { tableEditor.setModel(ptm); tableEditor.getColumnModel().getColumn(0).setMaxWidth(100); tableEditor.getColumnModel().getColumn(0).setMinWidth(100); activeEditor = tableEditor; } else if (value.getClass() == MondrianGuiDef.Closure.class) { tableEditor.getColumnModel().getColumn(0).setMinWidth(100); spcr.setTableRendererHeight(tableEditor, null); activeEditor = tableEditor;
propertyTable.getColumnModel().getColumn(0).setMinWidth(150);
private void setColumnWidth(int column, int width, int minwidth, int maxwidth) { TableColumn tc = getColumnModel().getColumn(column); tc.setPreferredWidth(width); if (maxwidth > 0) { tc.setMaxWidth(maxwidth); } if (minwidth > 0) { tc.setMinWidth(minwidth); } }