Mercurial > cgi-bin > hgweb.cgi > JpegWasher
diff src/name/blackcap/exifwasher/Misc.kt @ 54:40911898ed23
Fix multiple border glitches.
author | davidb |
---|---|
date | Thu, 07 May 2020 14:05:40 -0700 |
parents | cd2ca4727b7f |
children | f5faf70c7d10 |
line wrap: on
line diff
--- a/src/name/blackcap/exifwasher/Misc.kt Thu May 07 12:33:52 2020 -0700 +++ b/src/name/blackcap/exifwasher/Misc.kt Thu May 07 14:05:40 2020 -0700 @@ -13,6 +13,7 @@ import java.awt.Toolkit import java.awt.event.MouseEvent import javax.swing.* +import javax.swing.border.Border import javax.swing.table.TableColumnModel import kotlin.annotation.* import kotlin.properties.ReadWriteProperty @@ -219,3 +220,13 @@ } } +/** + * Add a border to a JComponent. The new border is in addition to (and outside + * of) whatever existing standard border the component had. + */ +fun JComponent.addBorder(b: Border) { + if (border == null) + border = b + else + border = BorderFactory.createCompoundBorder(b, border) +}