diff src/name/blackcap/exifwasher/WashDialog.kt @ 8:88d02fa97d78

Got WasherDialog table laying out somewhat sanely.
author David Barts <n5jrn@me.com>
date Fri, 10 Apr 2020 15:09:36 -0700
parents 65d14d44bc3f
children 0a106e9b91b4
line wrap: on
line diff
--- a/src/name/blackcap/exifwasher/WashDialog.kt	Fri Apr 10 13:44:04 2020 -0700
+++ b/src/name/blackcap/exifwasher/WashDialog.kt	Fri Apr 10 15:09:36 2020 -0700
@@ -83,16 +83,12 @@
                 } else {
                     myTable.run {
                         model = MyTableModel(tableData, COLUMN_NAMES)
-                        columnModel.run {
-                            getColumn(0).run {
-                                preferredWidth = 10
-                                maxWidth = 850000000 /* xxx - don't ask */
-                            }
-                            getColumn(1).preferredWidth = 100  /* key name */
-                            getColumn(2).preferredWidth = 5  /* type */
-                            getColumn(3).preferredWidth = 200  /* value */
-                        }
-                        autoResizeMode = JTable.AUTO_RESIZE_LAST_COLUMN
+                        autoResizeMode = JTable.AUTO_RESIZE_OFF
+                        setColWidth(0, 0, COLUMN_NAMES[0])
+                        setColWidth(1, 180, null)
+                        setColWidth(2, 72, "Undefined")
+                        setColWidth(3, 720, null)
+                        setOverallWidth()
                     }
                     setVisible(true)
                 }
@@ -200,7 +196,7 @@
                     alignmentX = JScrollPane.LEFT_ALIGNMENT
                     border = BorderFactory.createEmptyBorder(BW, BW, BW, BW)
                     verticalScrollBarPolicy = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
-                    horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER
+                    horizontalScrollBarPolicy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS
                     preferredSize = Dimension(WIDTH, HEIGHT)
                     background = Application.mainFrame.background
                 })
@@ -215,6 +211,7 @@
                 add(resetButton)
                 add(Box.createHorizontalGlue())
                 add(cancelButton)
+                add(Box.createHorizontalStrut(BW2))
                 add(washButton)
             })
         }