diff src/name/blackcap/exifwasher/ShowDialog.kt @ 9:0a106e9b91b4

Fix table layout; fix "select all for deletion" feature.
author David Barts <n5jrn@me.com>
date Fri, 10 Apr 2020 19:17:09 -0700
parents 65d14d44bc3f
children 9bbe6d803eba
line wrap: on
line diff
--- a/src/name/blackcap/exifwasher/ShowDialog.kt	Fri Apr 10 15:09:36 2020 -0700
+++ b/src/name/blackcap/exifwasher/ShowDialog.kt	Fri Apr 10 19:17:09 2020 -0700
@@ -28,11 +28,6 @@
     private val myTable = JTable(arrayOf<Array<Any>>(), COLUMN_NAMES).apply {
         autoCreateRowSorter = false
         rowSorter = null
-        columnModel.run {
-            getColumn(0).preferredWidth = 25  /* key name */
-            getColumn(1).preferredWidth = 15  /* type */
-            getColumn(2).preferredWidth = 100  /* value */
-        }
     }
 
     /* deliberately not the default, because this changes a file */
@@ -70,7 +65,14 @@
                         "Unable to read metadata.",
                         "Error", JOptionPane.ERROR_MESSAGE)
                 } else {
-                    myTable.model = MyTableModel(tableData, COLUMN_NAMES)
+                    myTable.run {
+                        model = MyTableModel(tableData, COLUMN_NAMES)
+                        autoResizeMode = JTable.AUTO_RESIZE_OFF
+                        setColWidth(0, 180, null)
+                        setColWidth(1, 72, "Undefined")
+                        setColWidth(2, 720, null)
+                        setOverallWidth()
+                    }
                     setVisible(true)
                 }
             }