String (@NotNull String columnHeader) { TableView table = getDualView().getFlatView(); if (table.getRowCount() == 0) return null; final Enumeration<TableColumn> columns = table.getColumnModel().getColumns(); int idx = 0; while (columns.hasMoreElements()) { TableColumn column = columns.nextElement(); if (columnHeader.equals(column.getHeaderValue())) { break; } ++idx; } if (idx >= table.getColumnModel().getColumnCount() - 1) return null; final FontMetrics fm = table.getFontMetrics(table.getFont().deriveFont(Font.BOLD)); final Object header = table.getColumnModel().getColumn(idx).getHeaderValue(); double maxValue = fm.stringWidth((String)header); String value = (String)header; for (int i = 0; i < table.getRowCount(); i++) { final Object at = table.getValueAt(i, idx); if (at instanceof String) { final int newWidth = fm.stringWidth((String)at); if (newWidth > maxValue) { maxValue = newWidth; value = (String)at; } } } return value + "ww"; // NON-NLS }