Select a file using JFileChooser using Netrexx

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Select a file using JFileChooser using Netrexx

Fernando Cassia-2
I currently looked in RosettaCode and there is no example of calling JFileChooser from NetRexx.

Would it be possible to call JFileChooser to select a file, even if the target is a Netrexx text mode program? Or do we have to bring in the whole Swing shebang?

I was thinking of something like this
but in NetRexx.

If someone is capable of adding it, it'd be nice... 
FC

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Select a file using JFileChooser using Netrexx

Marc Remes-2
Sure:

fc = JFileChooser()
rc = fc.showOpenDialog(null)
if rc == JFileChooser.APPROVE_OPTION then
   say 'Selected file: 'fc.getSelectedFile()


Marc

On 2/28/21 3:41 AM, Fernando Cassia wrote:

> I currently looked in RosettaCode and there is no example of calling JFileChooser from NetRexx.
> https://rosettacode.org/wiki/Category:NetRexx 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__rosettacode.org_wiki_Category-3ANetRexx&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=2ZNghoYeqHjset-LaMy8hAngIl3VPjXlMACjETh1HBo&s=LECxKmyM3LZTCrkvNtoGwOZcIOw8HVEci7Lb-m1rEWs&e=>
>
> Would it be possible to call JFileChooser to select a file, even if the target is a Netrexx text mode program? Or do we
> have to bring in the whole Swing shebang?
>
> I was thinking of something like this
> https://docwhat.org/jruby-filechooser-example 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__docwhat.org_jruby-2Dfilechooser-2Dexample&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=2ZNghoYeqHjset-LaMy8hAngIl3VPjXlMACjETh1HBo&s=sjFzVcEPysf16bNYljH-MpubXaddq2_MttAY_dBbRz0&e=>
> but in NetRexx.
>
> If someone is capable of adding it, it'd be nice...
> FC
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


OpenPGP_signature (505 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Select a file using JFileChooser using Netrexx

Fernando Cassia-2


On Sun., 28 Feb. 2021, 14:47 Marc Remes, <[hidden email]> wrote:
Sure:

fc = JFileChooser()
rc = fc.showOpenDialog(null)
if rc == JFileChooser.APPROVE_OPTION then
   say 'Selected file: 'fc.getSelectedFile()


Marc

Thanks Marc, 

I will test it later today. 

FC

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/