File tree 1 file changed +7
-1
lines changed
src/java.desktop/share/classes/javax/swing
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1997, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1997, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -1266,6 +1266,12 @@ public void setAutoResizeMode(int mode) {
1266
1266
autoResizeMode = mode ;
1267
1267
resizeAndRepaint ();
1268
1268
if (tableHeader != null ) {
1269
+ if (mode == JTable .AUTO_RESIZE_LAST_COLUMN ) {
1270
+ int colCnt = columnModel .getColumnCount ();
1271
+ if (colCnt > 0 ) {
1272
+ tableHeader .setResizingColumn (columnModel .getColumn (colCnt - 1 ));
1273
+ }
1274
+ }
1269
1275
tableHeader .resizeAndRepaint ();
1270
1276
}
1271
1277
firePropertyChange ("autoResizeMode" , old , autoResizeMode );
You can’t perform that action at this time.
0 commit comments