This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems with java.awt.FileDialog


Asking about how I compile/run the file got me thinking. Actually, I've been
doing most of my development work from inside Eclipse (using SchemeWay), and
I test by executing (loading) the currently edited file using kawa as an
external interpreter, which I've set up to run:

java kawa.repl -s

I hadn't thought of this being any different from running outside of
Eclipse, but I just tried, and it IS different. If I run:

java kawa.repl

from the command line and then do a (load "filetest.scm"), opening the file
dialog works fine. Similarly, compiling and running as you suggested also
works fine.

So, it seems that the problem is related to how Eclipse is interacting with
the interpreter. I'll just avoid this by switching to testing my code from
the command line, at least for Windows, and use Eclipse just as an editor.

thanks,
Alex


On 9/12/09 1:18 PM, "Per Bothner" <per@bothner.com> wrote:

> On 09/11/2009 09:10 AM, alex mitchell wrote:
>> I¹m resending this as my previous posts didn¹t seem to go through. Apologies
>> if this is a duplicate posting.
>> 
>> I had previously posted that I was having problems with
>> javax.swing.JFileChooser, specifically that it was hanging when invoking
>> 'showOpenDialog. This seems to be a commonly reported bug, so I've switched
>> to java.awt.FileDialog. However, I'm still having problems. In the following
>> code, if I choose File->Open, the file dialog never appears. However, if I
>> call (test) directly, the file dialog appears immediately. Interestingly, if
>> I call (test) _after_ I've done File->Open, _both_ file dialog boxes appear.
>> Similarly, if I call (test) first, and then try to open a file from the
>> menu, the file dialog opens correctly. So it seems that calling (test) from
>> the actionListener causes it to hang trying to get the directory contents.
>> The equivalent code in Java doesn't have this problem, so I'm assuming this
>> is a Kawa issue. Anyone have any ideas?
> 
> Indeed, it seems to work on Fedora GNU/Linux.
> 
> How do you compile/run filetest.scm?  Probably closest to the Java
> version would be:
> 
> java kawa.repl --main -C filetest.scm
> java filetest
> 
> Adding the following flags may also be a good idea:
> --warn-undefined-variable --warn-inve-unknown-method --warn-as-error
> 
> I notice when I do that I get a lot of warnings, which means
> you'll end up using reflection at run-time.  I fixed those,
> and got the attached program.  You could try that.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]