File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
sources/net.sf.j2s.java.core/src/test Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,45 @@ public void run() {
158158 });
159159 p .add (b );
160160
161+ b = new JButton ("FileSaveDialog" );
162+ b .addActionListener (new ActionListener () {
163+
164+ @ Override
165+ public void actionPerformed (ActionEvent e ) {
166+ AsyncFileChooser fc = new AsyncFileChooser ();
167+ fc .showSaveDialog (Test_Dialog2 .this , new Runnable () {
168+
169+ @ Override
170+ public void run () {
171+ File file = fc .getSelectedFile ();
172+ String msg = "FileChooser returned " + file ;
173+ System .out .println (msg );
174+ status .setText (msg );
175+ }
176+
177+ }, null );
178+ }
179+
180+ });
181+ p .add (b );
182+
183+ b = new JButton ("FileSaveDialog2" );
184+ b .addActionListener (new ActionListener () {
185+
186+ @ Override
187+ public void actionPerformed (ActionEvent e ) {
188+ JFileChooser fc = new JFileChooser ();
189+ int ret = fc .showSaveDialog (Test_Dialog2 .this );
190+ File file = fc .getSelectedFile ();
191+ String msg = "FileChooser returned " + ret + " " + file + (file == null ? "" : " path=" + file .getAbsolutePath ());
192+ System .out .println (msg );
193+ status .setText (msg );
194+ }
195+
196+ });
197+ p .add (b );
198+
199+
161200 b = colorButton = new JButton ("ColorDialog" );
162201 b .addActionListener (new ActionListener () {
163202
You can’t perform that action at this time.
0 commit comments