aspose file tools*
The moose likes Applets and the fly likes JFileChooser Applet do not close on button click Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "JFileChooser Applet do not close on button click" Watch "JFileChooser Applet do not close on button click" New topic
Author

JFileChooser Applet do not close on button click

Dinesh Pise
Greenhorn

Joined: Jul 18, 2012
Posts: 27
Hi Friends,

I have create a JFileChooser in my class and displaying it in JSP using applet to select directory by user. I have signed my applet and I am able to display it in JSP, every thing is working fine like I can get the directory path etc. But when I click on open or close/windows close button the JFileChooser do close. And more thing I have compiled class file in JDK 1.6 and is working fine on client machine having 1.6but fails it client machine have JDK 1.7.

Below is my class and JSP.

JSP Code:



Class Code:



Thanks,
Dinesh Pise
Dinesh Pise
Greenhorn

Joined: Jul 18, 2012
Posts: 27
Moderator can you please move this to applet section or else please let me know if I can move this.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10376
    
    8

I moved it for you. In future CarefullyChooseOneForum

You are doing it wrong. Overriding paintComponent (and not paint) for swing components should be done when you want to have custom painting on the container.
For proper usage of JFileChooser check out http://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Dinesh Pise
Greenhorn

Joined: Jul 18, 2012
Posts: 27
Hi, Will take care in posting right forum. I changed my code little bit instead of putting the code in paint method I replaced it with init method. Now my next challenge is to Java applet console.

Below is working code :

Dinesh Pise
Greenhorn

Joined: Jul 18, 2012
Posts: 27
Hi, Now I am stuck in getting value from applet. Below is my code but how to get those values in jsp/servlet.

1st code : But no success then tried code 2





Now both the code are not working how to get chooser.getSelectedFile().toString() value.

Regards,
Dinesh Pise
Dinesh Pise
Greenhorn

Joined: Jul 18, 2012
Posts: 27
Hi Friends,

My query is resolved I just followed the simple steps given in the link of mkyong Applet to Javascript Call

Thanks & Regards,
Dinesh Pise
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFileChooser Applet do not close on button click