Lines 211-233
Link Here
|
211 |
int inset = 10; |
211 |
int inset = 10; |
212 |
TableColumnModel columnModel = table.getColumnModel(); |
212 |
TableColumnModel columnModel = table.getColumnModel(); |
213 |
|
213 |
|
214 |
TableColumn priorityColumn = columnModel.getColumn(0); |
214 |
TableColumn priorityColumn = columnModel.getColumn(NotificationTableModel.PRIORITY_COLUMN); |
215 |
String priorName = priorityColumn.getHeaderValue().toString(); |
215 |
String priorName = priorityColumn.getHeaderValue().toString(); |
216 |
priorityColumn.setPreferredWidth(fm.stringWidth(priorName) + inset); |
216 |
priorityColumn.setPreferredWidth(fm.stringWidth(priorName) + inset); |
217 |
|
217 |
|
218 |
TableColumn dateColumn = columnModel.getColumn(2); |
218 |
TableColumn iconColumn = columnModel.getColumn(NotificationTableModel.ICON_COLUMN); |
|
|
219 |
String iconName = iconColumn.getHeaderValue().toString(); |
220 |
iconColumn.setPreferredWidth(fm.stringWidth(iconName) + inset); |
221 |
|
222 |
TableColumn dateColumn = columnModel.getColumn(NotificationTableModel.TIMESTAMP_COLUMN); |
219 |
dateColumn.setPreferredWidth(15 * maxCharWidth + inset); |
223 |
dateColumn.setPreferredWidth(15 * maxCharWidth + inset); |
220 |
|
224 |
|
221 |
TableColumn categoryColumn = columnModel.getColumn(3); |
225 |
TableColumn categoryColumn = columnModel.getColumn(NotificationTableModel.CATEGORY_COLUMN); |
222 |
categoryColumn.setPreferredWidth(7 * maxCharWidth + inset); |
226 |
categoryColumn.setPreferredWidth(7 * maxCharWidth + inset); |
223 |
|
227 |
|
224 |
TableColumn messageColumn = columnModel.getColumn(1); |
228 |
TableColumn messageColumn = columnModel.getColumn(NotificationTableModel.MESSAGE_COLUMN); |
225 |
Insets insets = notificationScroll.getBorder().getBorderInsets(notificationScroll); |
229 |
Insets insets = notificationScroll.getBorder().getBorderInsets(notificationScroll); |
226 |
int remainingWidth = notificationScroll.getParent().getWidth() - insets.left - insets.right; |
230 |
int remainingWidth = notificationScroll.getParent().getWidth() - insets.left - insets.right; |
227 |
remainingWidth -= 3 * columnModel.getColumnMargin(); |
231 |
remainingWidth -= 3 * columnModel.getColumnMargin(); |
228 |
remainingWidth -= priorityColumn.getPreferredWidth(); |
232 |
remainingWidth -= priorityColumn.getPreferredWidth(); |
229 |
remainingWidth -= dateColumn.getPreferredWidth(); |
233 |
remainingWidth -= dateColumn.getPreferredWidth(); |
230 |
remainingWidth -= categoryColumn.getPreferredWidth(); |
234 |
remainingWidth -= categoryColumn.getPreferredWidth(); |
|
|
235 |
remainingWidth -= iconColumn.getPreferredWidth(); |
231 |
messageColumn.setPreferredWidth(remainingWidth); |
236 |
messageColumn.setPreferredWidth(remainingWidth); |
232 |
} |
237 |
} |
233 |
|
238 |
|