private InspectorTable(@NotNull final Component component) { setLayout(new BorderLayout()); myModel = new InspectorTableModel(component); StripeTable table = new StripeTable(myModel); new TableSpeedSearch(table); TableColumnModel columnModel = table.getColumnModel(); TableColumn propertyColumn = columnModel.getColumn(0); propertyColumn.setMinWidth(150); propertyColumn.setMaxWidth(150); propertyColumn.setResizable(false); TableColumn valueColumn = columnModel.getColumn(1); valueColumn.setMinWidth(200); valueColumn.setResizable(false); valueColumn.setCellRenderer(new ValueCellRenderer()); table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); add(new JBScrollPane(table), BorderLayout.CENTER); myDimensionComponent = new DimensionsComponent(component); add(myDimensionComponent, BorderLayout.SOUTH); }
private InspectorTable(@NotNull final Component component) { setLayout(new BorderLayout()); myTitleLabel = new JLabel(component.getClass().getCanonicalName(), SwingConstants.CENTER); myModel = new InspectorTableModel(component); final StripeTable table = new StripeTable(myModel); TableColumnModel columnModel = table.getColumnModel(); TableColumn propertyColumn = columnModel.getColumn(0); propertyColumn.setMinWidth(150); propertyColumn.setMaxWidth(150); propertyColumn.setResizable(false); TableColumn valueColumn = columnModel.getColumn(1); valueColumn.setMinWidth(200); valueColumn.setResizable(false); valueColumn.setCellRenderer(new ValueCellRenderer()); table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN); add(myTitleLabel, BorderLayout.NORTH); add(new JBScrollPane(table), BorderLayout.CENTER); myDimensionComponent = new DimensionsComponent(component); add(myDimensionComponent, BorderLayout.SOUTH); }
private void initColumnWidth(StripeTable table) { DefaultTableColumnModel columnModel = (DefaultTableColumnModel) table.getColumnModel(); columnModel.getColumn(0).setPreferredWidth(300); }