@@ -7,7 +7,6 @@ import java.awt.event._
77import javax .swing .Box
88import javax .swing .BoxLayout
99import javax .swing .DefaultCellEditor
10- import javax .swing .JFileChooser
1110import javax .swing .JComboBox
1211import javax .swing .table .TableColumn
1312import javax .swing .table .TableCellEditor
@@ -33,6 +32,7 @@ import scala.swing._
3332import scala .swing .event ._
3433import scala .swing .Table
3534import scala .swing .Container
35+ import scala .swing .FileChooser
3636
3737/**
3838 * <code>NodeDialog</code> for the "JRuby Script" Node.
@@ -69,7 +69,7 @@ class RubyScriptNodeDialog(private var factory: RubyScriptNodeFactory)
6969
7070 private var columnTables : Array [Table ] = _
7171
72- private val fileChooser = new JFileChooser ()
72+ private val fileChooser = new FileChooser ()
7373
7474 createColumnSelectionTab()
7575
@@ -179,9 +179,9 @@ class RubyScriptNodeDialog(private var factory: RubyScriptNodeFactory)
179179 layout(new Button (" Load Script from File" ) {
180180 reactions += {
181181 case ButtonClicked (b) =>
182- val returnVal = fileChooser.showOpenDialog(b.peer )
183- if (returnVal == JFileChooser . APPROVE_OPTION ) {
184- val file = fileChooser.getSelectedFile
182+ val returnVal = fileChooser.showOpenDialog(b)
183+ if (returnVal == FileChooser . Result . Approve ) {
184+ val file = fileChooser.selectedFile
185185 if (file.exists()) {
186186 val file_content = scala.io.Source .fromFile(file, " utf-8" ).mkString
187187 scriptTextArea.setText(file_content)
@@ -193,7 +193,7 @@ class RubyScriptNodeDialog(private var factory: RubyScriptNodeFactory)
193193
194194 layout(new Label (" Ruby Script" )) = BorderPanel .Position .Center
195195 }
196- peer.add (scriptButtonPanel.peer, BorderLayout . PAGE_START )
196+ layout (scriptButtonPanel) = BorderPanel . Position . North
197197
198198 layout(new BorderPanel () {
199199 layout(new SplitPane (Orientation .Horizontal ,
0 commit comments