@@ -40,7 +40,6 @@ import scala.util.Using
4040 * @author Adam Retter <[email protected] > 4141 */
4242object CsvValidatorUi extends SimpleSwingApplication {
43-
4443 override def startup (args : Array [String ]) : Unit = {
4544 try {
4645 UIManager .setLookAndFeel(UIManager .getSystemLookAndFeelClassName)
@@ -52,10 +51,11 @@ object CsvValidatorUi extends SimpleSwingApplication {
5251 }
5352
5453 def top = new SJXFrame {
54+
5555 title = " CSV Validator"
5656 peer.setDefaultCloseOperation(WindowConstants .EXIT_ON_CLOSE )
5757 contents = {
58- val settings = new SettingsPanel
58+ val settings = new SettingsPanel ( this )
5959
6060 // handle resizing the main window, when resizing the settings panel
6161 settings.settingsGroup.reactions += SJXTaskPane .onViewStateChanged {
@@ -64,10 +64,9 @@ object CsvValidatorUi extends SimpleSwingApplication {
6464 } else {
6565 new Dimension (this .size.getWidth.toInt, (this .size.getHeight + settings.size.getHeight).toInt)
6666 }
67- this .size = newSize
67+ this .preferredSize = newSize
6868 this .pack()
6969 }
70-
7170 new ContentPanel (settings)
7271 }
7372 }
@@ -408,7 +407,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
408407 * us to break up the code easily, hopefully
409408 * making it more understandable.
410409 */
411- private class SettingsPanel extends SJXTaskPaneContainer {
410+ private class SettingsPanel ( parentFrame : SJXFrame ) extends SJXTaskPaneContainer {
412411
413412 private lazy val CHARACTER_ENCODINGS =
414413 if (Charset .defaultCharset.name == " UTF-8" ) {
@@ -455,7 +454,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
455454
456455 private val spTblPathSubstitutions = new ScrollPane (tblPathSubstitutions)
457456 private val btnAddPathSubstitution = new Button (" Add Path Substitution..." )
458- btnAddPathSubstitution.reactions += onClick(addToTableDialog(top , " Add Path Substitution..." , tblPathSubstitutions, tblPathSubstitutions.addRow))
457+ btnAddPathSubstitution.reactions += onClick(addToTableDialog(parentFrame , " Add Path Substitution..." , tblPathSubstitutions, tblPathSubstitutions.addRow))
459458
460459 private val settingsGroupLayout = new GridBagPanel {
461460 private val c = new Constraints
0 commit comments