On Wed, 21 Jan 2026 06:11:50 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> src/java.desktop/share/classes/javax/swing/JTable.java line 3204:
>>
>>> 3202: // AUTO_RESIZE_LAST_COLUMN autoResizeMode
>>> 3203: for (int i = 0; i < columnModel.getColumnCount(); i++) {
>>> 3204: if (columnModel.getColumn(i).getPreferredWidth() != 75
>>
>> Why are we using hardcoded value here ? Any particular reason for checking
>> width against value `75` ?
>
> Because default width is such and there is no way to ascertain default width..
> https://github.com/openjdk/jdk/blob/b5727d27622e1e321733f8d0e606b366984104be/src/java.desktop/share/classes/javax/swing/table/TableColumn.java#L523-L524
>
> https://github.com/openjdk/jdk/blob/b5727d27622e1e321733f8d0e606b366984104be/src/java.desktop/share/classes/javax/swing/table/TableColumn.java#L556-L557
Got it, it's been set here -
https://github.com/openjdk/jdk/blob/b5727d27622e1e321733f8d0e606b366984104be/src/java.desktop/share/classes/javax/swing/table/TableColumn.java#L211
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29291#discussion_r2711169026