Fermer page html a partir d'une applet
Fermé
Bonjour,
je pense que tout est dans le titre,
j'ai une applet java qui s'ouvre à partir d'une page html, et j'aimerai que quand j'appuie
sur un bouton, la page qui contient l'applet se ferme, le probleme c'est que je ne trouve pas
de méthode pour, j'ai bien la façon d'ouvrir la page html , mais pas pour la fermer.
merci beaucoup
je pense que tout est dans le titre,
j'ai une applet java qui s'ouvre à partir d'une page html, et j'aimerai que quand j'appuie
sur un bouton, la page qui contient l'applet se ferme, le probleme c'est que je ne trouve pas
de méthode pour, j'ai bien la façon d'ouvrir la page html , mais pas pour la fermer.
merci beaucoup
A voir également:
- Fermer page html a partir d'une applet
- Supprimer une page word - Guide
- Creer un groupe whatsapp a partir d'un autre groupe - Guide
- Comment faire une recherche à partir d'une photo - Guide
- Imprimer tableau excel sur une page - Guide
- Editeur html - Télécharger - HTML
3 réponses
merci pour ta réponse, mais c'est une applet,pas une JFrame, donc la méthode dispose() ne fonctionne pas, tout comme la méthode close().
Utilisateur anonyme
3 mars 2008 à 17:50
3 mars 2008 à 17:50
J'ai trouvé ce commentaire sur le net :
Why do you want to "exit" the applet? To make the form disappear after data entry?
The JVM that the browser uses will prevent an untrusted applet from accessing the local file system or executing anything on the local system. That was one of the reasons for applets' popularity - they can't trash a local system accidentally or otherwise. The destroy() method is called by the browser only when the page closes. Calling it yourself from within the applet will execute any code that it contains but still will not "exit" the applet.
Try using:
setVisible(false) on the main container object or setPreferredSize(0,0)...
Apparement tu ne peux pas fermer l'applet sur le clic d'un bouton par contre tu peux la rendre non visible.
Why do you want to "exit" the applet? To make the form disappear after data entry?
The JVM that the browser uses will prevent an untrusted applet from accessing the local file system or executing anything on the local system. That was one of the reasons for applets' popularity - they can't trash a local system accidentally or otherwise. The destroy() method is called by the browser only when the page closes. Calling it yourself from within the applet will execute any code that it contains but still will not "exit" the applet.
Try using:
setVisible(false) on the main container object or setPreferredSize(0,0)...
Apparement tu ne peux pas fermer l'applet sur le clic d'un bouton par contre tu peux la rendre non visible.