diff src/name/blackcap/clipman/PasteboardView.kt @ 28:f1fcc1281dad

Use BorderFactory; clean up Find dialog.
author David Barts <n5jrn@me.com>
date Wed, 29 Jan 2020 13:39:14 -0800
parents 8aa2dfac27eb
children c4f53bc01732
line wrap: on
line diff
--- a/src/name/blackcap/clipman/PasteboardView.kt	Wed Jan 29 10:50:07 2020 -0800
+++ b/src/name/blackcap/clipman/PasteboardView.kt	Wed Jan 29 13:39:14 2020 -0800
@@ -6,7 +6,6 @@
 import java.awt.Color
 import java.awt.Dimension
 import javax.swing.*
-import javax.swing.border.*
 import javax.swing.text.html.StyleSheet
 import javax.swing.text.html.HTMLEditorKit
 
@@ -20,10 +19,12 @@
  * What we use to display the text that is or was in the clipboard.
  */
 class ClipText: JTextPane() {
-    private val normalBorder = CompoundBorder(LineBorder(Color.GRAY, INNER_BORDER),
-            EmptyBorder(MARGIN_BORDER, MARGIN_BORDER, MARGIN_BORDER, MARGIN_BORDER))
-    private val selectedBorder = CompoundBorder(LineBorder(Color.BLACK, INNER_BORDER+1),
-            EmptyBorder(MARGIN_BORDER-1, MARGIN_BORDER-1, MARGIN_BORDER-1, MARGIN_BORDER-1))
+    private val normalBorder = BorderFactory.createCompoundBorder(
+            BorderFactory.createLineBorder(Color.GRAY, INNER_BORDER),
+            BorderFactory.createEmptyBorder(MARGIN_BORDER, MARGIN_BORDER, MARGIN_BORDER, MARGIN_BORDER))
+    private val selectedBorder = BorderFactory.createCompoundBorder(
+            BorderFactory.createLineBorder(Color.BLACK, INNER_BORDER+1),
+            BorderFactory.createEmptyBorder(MARGIN_BORDER-1, MARGIN_BORDER-1, MARGIN_BORDER-1, MARGIN_BORDER-1))
     init {
         border = normalBorder
         setEditable(false)
@@ -88,7 +89,7 @@
  */
 class PasteboardItemView(label: String, val searchable: ClipText) {
     private val outerBorder =
-        MatteBorder(OUTER_BORDER_TOP, OUTER_BORDER, OUTER_BORDER, OUTER_BORDER,
+        BorderFactory.createMatteBorder(OUTER_BORDER_TOP, OUTER_BORDER, OUTER_BORDER, OUTER_BORDER,
             queue.v.parent.background)
 
     val contents = JPanel().apply {