JTableHeader th = table.getTableHeader(); TableColumnModel tcm = th.getColumnModel(); TableColumn tc = tcm.getColumn(0); tc.setHeaderValue( "???" ); th.repaint();
private JComponent getChooserPanel() { JPanel p = new JPanel(new BorderLayout()); p.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); p.setOpaque(false); JLabel l = new JLabel("Please choose installation directory:"); l.setVerticalAlignment(JLabel.NORTH); l.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); p.add(l, BorderLayout.NORTH); table = new JTable(installations); table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setColumnSelectionAllowed(false); table.setDefaultRenderer(Object.class, new InstallationTableCellRenderer()); table.getColumnModel().getColumn(0).setHeaderValue("Directory"); table.getColumnModel().getColumn(0).setPreferredWidth(300); table.getColumnModel().getColumn(1).setHeaderValue("Java Version"); table.getColumnModel().getColumn(3).setPreferredWidth(100); table.getColumnModel().getColumn(2).setHeaderValue("Type"); table.getColumnModel().getColumn(3).setPreferredWidth(100); table.getColumnModel().getColumn(3).setHeaderValue("Replaced by DCEVM?"); table.getColumnModel().getColumn(3).setPreferredWidth(200); table.getColumnModel().getColumn(4).setHeaderValue("Installed altjvm?"); table.getColumnModel().getColumn(4).setPreferredWidth(200); JScrollPane lists = new JScrollPane(table); lists.setPreferredSize(new Dimension(900, 200)); p.add(lists, BorderLayout.CENTER); return p; }
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()); }
getColumnModel().getColumn(0).setHeaderValue("Enabled"); getColumnModel().getColumn(0).setMinWidth(50); getColumnModel().getColumn(0).setMaxWidth(50); getColumnModel().getColumn(0).setPreferredWidth(50); getColumnModel().getColumn(1).setHeaderValue("Lease"); getColumnModel().getColumn(1).setMinWidth(50); getColumnModel().getColumn(1).setMaxWidth(50); getColumnModel().getColumn(1).setPreferredWidth(50); getColumnModel().getColumn(2).setHeaderValue("WAN Host"); getColumnModel().getColumn(2).setMinWidth(60); getColumnModel().getColumn(2).setMaxWidth(150); getColumnModel().getColumn(2).setPreferredWidth(60); getColumnModel().getColumn(3).setHeaderValue("WAN Port"); getColumnModel().getColumn(3).setMinWidth(60); getColumnModel().getColumn(3).setMaxWidth(60); getColumnModel().getColumn(3).setPreferredWidth(60); getColumnModel().getColumn(4).setHeaderValue("Protocol"); getColumnModel().getColumn(4).setMinWidth(60); getColumnModel().getColumn(4).setMaxWidth(60); getColumnModel().getColumn(4).setPreferredWidth(60); getColumnModel().getColumn(5).setHeaderValue("LAN Host"); getColumnModel().getColumn(5).setMinWidth(80); getColumnModel().getColumn(5).setMaxWidth(150); getColumnModel().getColumn(5).setPreferredWidth(80);
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) ); }
private void initLocalization() { saveButton.setText(Localization.getString("save")); closeButton.setText(Localization.getString("close")); importButton.setText(Localization.getString("import")); exportButton.setText(Localization.getString("export")); TableColumnModel tcm = settingsTable.getTableHeader().getColumnModel(); tcm.getColumn(0).setHeaderValue(Localization.getString("setting")); tcm.getColumn(1).setHeaderValue(Localization.getString("value")); tcm.getColumn(2).setHeaderValue(Localization.getString("description")); settingsTable.getTableHeader().repaint(); }
public void loadData(Collection<RoomUsersView> roomUserInfoList) throws MageRemoteException { RoomUsersView roomUserInfo = roomUserInfoList.iterator().next(); this.players = roomUserInfo.getUsersView().toArray(new UsersView[0]); JTableHeader th = jTablePlayers.getTableHeader(); TableColumnModel tcm = th.getColumnModel(); tcm.getColumn(jTablePlayers.convertColumnIndexToView(tableInfo.getColumnByName("Players").getIndex())).setHeaderValue("Players (" + this.players.length + ')'); tcm.getColumn(jTablePlayers.convertColumnIndexToView(tableInfo.getColumnByName("Games").getIndex())).setHeaderValue("Games " + roomUserInfo.getNumberActiveGames() + (roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads() : " (") + " limit: " + roomUserInfo.getNumberMaxGames() + ')'); th.repaint(); this.fireTableDataChanged(); }
String columnName = "Column X"; model.addColumn( columnName ); // AutoCreate is turned off so create table column here TableColumn column = new TableColumn( table.getColumnCount() ); column.setHeaderValue( columnNamer ); table.addColumn( column );
String header = "Col" + (table.getColumnCount() + 1); model.addColumn( header ); // AutoCreate is turned off so create table column here TableColumn column = new TableColumn( table.getColumnCount() ); column.setHeaderValue( header ); table.addColumn( column );
public void setTitle(String aTitle) { if (tableColumn != null) { tableColumn.setHeaderValue(aTitle); } else { if (title == null ? aTitle != null : !title.equals(aTitle)) { String oldTtile = title; title = aTitle; changeSupport.firePropertyChange("title", oldTtile, title); } } }
colMod.getColumn(0).setHeaderValue(I18nView.valueByKey("NETWORK_TAB_METHOD_COLUMN")); colMod.getColumn(1).setHeaderValue(I18nView.valueByKey("NETWORK_TAB_URL_COLUMN")); colMod.getColumn(2).setHeaderValue(I18nView.valueByKey("NETWORK_TAB_SIZE_COLUMN")); colMod.getColumn(3).setHeaderValue(I18nView.valueByKey("NETWORK_TAB_TYPE_COLUMN")); } else { StyleConstants.setFontFamily(SwingAppender.ERROR, HelperUi.FONT_NAME_UBUNTU_MONO); colMod.getColumn(0).setHeaderValue(I18n.valueByKey("NETWORK_TAB_METHOD_COLUMN")); colMod.getColumn(1).setHeaderValue(I18n.valueByKey("NETWORK_TAB_URL_COLUMN")); colMod.getColumn(2).setHeaderValue(I18n.valueByKey("NETWORK_TAB_SIZE_COLUMN")); colMod.getColumn(3).setHeaderValue(I18n.valueByKey("NETWORK_TAB_TYPE_COLUMN"));
private void setTableColumnsNames(String[] columnNames) { TableColumnModel columnModel = getColumnModel(); for (int i = 0; i < columnNames.length; i++) { TableColumn column = columnModel.getColumn(i); column.setHeaderValue(columnNames[i]); } }
/** * {@inheritDoc} */ @Override public TableColumn createLeft(int aInsetSize, int aNewInsettedColumnIndex) { TableColumn col = new TableColumn(aNewInsettedColumnIndex-aInsetSize); col.setHeaderValue(" "); return col; }
/** * Sets the column name. * * @param col * the col * @param name * the name */ // /////////////////////////////////////////////////////////////////// public void setColumnName(final int col, final String name) { getColumnModel().getColumn(col).setHeaderValue(name); }
private void resetSearch() { if (searchColumn != -1) { String originalValue = data.getColumnName(searchColumn); table.getColumnModel().getColumn(searchColumn).setHeaderValue(originalValue); table.getTableHeader().repaint(); } searchColumn = -1; search = ""; searchTimer.stop(); }
public void refreshColumnNames(TableModel model) { for (TableColumn col : allColumns) { String colName = model.getColumnName(col.getModelIndex()); col.setHeaderValue(colName); } }
public TableColumn createTableColumn( String name ){ int mi = modelIndexOfColumn(name); if( mi<0 )return null; TableColumn tc = new TableColumn(mi); tc.setIdentifier(name); tc.setHeaderValue(name); tc.setModelIndex(mi); tc.setPreferredWidth(50); tc.setCellRenderer(renderer); return tc; }
public void editingStopped(ChangeEvent e) { TableCellEditor editor = getCellEditor(); if (editor != null) { Object value = editor.getCellEditorValue(); int index = getEditingColumn(); columnModel.getColumn(index).setHeaderValue(value); removeEditor(); } }
public void showColumn(final int _modelIndex){ final TableColumn col = new TableColumn(_modelIndex); col.setIdentifier(getTable().getModel().getColumnName(_modelIndex)); col.setHeaderValue(col.getIdentifier()); getColumnModel().addColumn(col); adjustWidth(col); }
private TableColumn makeTableColumn(int x, Sortables c) { TableColumn tc = new TableColumn(x); FBTableCellRenderer temp = new FBTableCellRenderer(); tc.setHeaderRenderer(temp); tc.setIdentifier(c); tc.setHeaderValue(c); tc.setResizable(false); tc.sizeWidthToFit(); return tc; }