This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFileChooser in an applet

 
Christophe Monnet
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have signed my applet so it can write a file on the user's disk. This is working when the path is hardcoded.
But I would like to let the user choose where to save the file.
So I use the JFileChooser like this:

This always makes the browser to crash. The dialog box appears but any interaction with it (click, move...) makes the browser to crash. I have to kill the process.
What's wrong with JFileChooser in applets ?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Christophe,
I don't think you should be having any problem. You didn't specify which Browser and version you were using. I have tried similar code on IE version 6 and have no problems. I have included the java code below and the HTML file inside it as a comment.

Enjoy,
Manfred.
 
Christophe Monnet
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried your example and yes it works!
The SAME code when called from my applet makes IE6 and NS6.1 to crash !
The only difference being that I don't launch the JFileChooser with a JButton but by calling a public function. And this public function is called in the browser via JavaScript.

When I click on the link "testWriteFile" the JFileChooser appears and then browser "not responding" in TaskManager.
[This message has been edited by Christophe Monnet (edited November 27, 2001).]
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!