• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFileChooser Applet do not close on button click

 
Dinesh Pise
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moderator can you please move this to applet section or else please let me know if I can move this.
 
Maneesh Godbole
Saloon Keeper
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dinesh Pise
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic