RFR: 8375573: JTable ignores setPreferredWidth during initial layout when AUTO_RESIZE_LAST_COLUMN is enabled [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Jan 23 03:31:36 UTC 2026


On Thu, 22 Jan 2026 10:24:10 GMT, Tejesh R <tr at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Bail out early if prefSize is set for a column
>
> src/java.desktop/share/classes/javax/swing/JTable.java line 3206:
> 
>> 3204:             if (columnModel.getColumn(i).getPreferredWidth() != 75
>> 3205:                     && columnModel.getColumn(i).getWidth() == 75) {
>> 3206:                 prefWidthSet = true;
> 
> Can break the loop for first true condition instead of iterating through all the columns ?

Yes, can do..Updated..

> test/jdk/javax/swing/JTable/TestJTableColWidth.java line 81:
> 
>> 79:                 }
>> 80:             } finally {
>> 81:                 if (frame != null) {
> 
> Normally we do this inside EDT.

its already under EDT

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29291#discussion_r2719444083
PR Review Comment: https://git.openjdk.org/jdk/pull/29291#discussion_r2719445082


More information about the client-libs-dev mailing list