# HG changeset patch # User David Barts # Date 1579460018 28800 # Node ID 0640efd6b54a746b302521902cd124a805c3e57c # Parent d832c7b2bfd0c06c5e3976b56c016ad9fa54759e Tweak borders (incomplete). diff -r d832c7b2bfd0 -r 0640efd6b54a src/name/blackcap/clipman/Main.kt --- a/src/name/blackcap/clipman/Main.kt Sat Jan 18 12:55:26 2020 -0800 +++ b/src/name/blackcap/clipman/Main.kt Sun Jan 19 10:53:38 2020 -0800 @@ -38,6 +38,7 @@ // and the one we do override fun windowClosing(e: WindowEvent) { thr.run { interrupt(); join() } + LOGGER.log(Level.INFO, "execution complete") System.exit(0) } } @@ -46,7 +47,7 @@ class UpdateIt(val queue: PasteboardQueue, val interval: Int): Thread() { @Volatile var enabled = true private val stdBorder = - CompoundBorder(EmptyBorder(5, 10, 5, 10), LineBorder(Color.GRAY, 1)) + CompoundBorder(LineBorder(Color(0xeeeeee), 9), LineBorder(Color.GRAY, 1)) override fun run() { var oldContents = "" @@ -108,18 +109,21 @@ fun main(args: Array) { LOGGER.log(Level.INFO, "beginning execution") + val frame = JFrame("ClipMan").apply { preferredSize = Dimension(640, 480) } val con = JPanel().apply { layout = BoxLayout(this, BoxLayout.Y_AXIS) + border = EmptyBorder(9, 9, 9, 9) + background = frame.background } - var frame: JFrame? = null inSwingThread { - frame = JFrame("ClipMan").apply { - preferredSize = Dimension(640, 480) + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + frame.apply { contentPane.add( JScrollPane(con).apply { verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER preferredSize = Dimension(640, 480) + background = frame.background }, BorderLayout.CENTER) pack() setVisible(true) @@ -127,8 +131,7 @@ } val queue = PasteboardQueue(con, 10) val updater = UpdateIt(queue, 1000).apply { start() } - inSwingThread { frame?.addWindowListener(KillIt(updater)) } - LOGGER.log(Level.INFO, "execution complete") + inSwingThread { frame.addWindowListener(KillIt(updater)) } } fun inSwingThread(block: () -> Unit) {