comparison src/name/blackcap/exifwasher/Misc.kt @ 22:cd2ca4727b7f

Builds under Windows.
author davidb
date Thu, 16 Apr 2020 11:10:39 -0700
parents 539c3641c539
children 40911898ed23
comparison
equal deleted inserted replaced
21:539c3641c539 22:cd2ca4727b7f
175 175
176 /** 176 /**
177 * Set column width of a table. 177 * Set column width of a table.
178 */ 178 */
179 fun JTable.setColWidth(col: Int, width: Int, string: String?) { 179 fun JTable.setColWidth(col: Int, width: Int, string: String?) {
180 val FUZZ = 4 180 val FUZZ = 16
181 columnModel.getColumn(col).preferredWidth = if (string.isNullOrEmpty()) { 181 columnModel.getColumn(col).preferredWidth = if (string.isNullOrEmpty()) {
182 width 182 width
183 } else { 183 } else {
184 maxOf(width, graphics.fontMetrics.stringWidth(string) + FUZZ) 184 maxOf(width, graphics.fontMetrics.stringWidth(string) + FUZZ)
185 } 185 }