Applet

daly2000 Messages postés 12 Date d'inscription samedi 23 décembre 2006 Statut Membre Dernière intervention 4 juin 2007 - 24 avril 2007 à 11:39
chris081 Messages postés 90 Date d'inscription mercredi 24 décembre 2008 Statut Membre Dernière intervention 4 février 2009 - 17 janv. 2009 à 18:02
comment je peut faire l'appel d'une applet à partir d'un boutton d'une autre Applet!
à mes amis----------------> to dream...........reality.

2 réponses

chris081 Messages postés 90 Date d'inscription mercredi 24 décembre 2008 Statut Membre Dernière intervention 4 février 2009
17 janv. 2009 à 18:01
Error convertoring HTML to XHTML: System.Exception: Unexpected EOF parsing start tag 'a'
at FreeTextBoxControls.Support.Sgml.Entity.Error(String msg, String arg)
at FreeTextBoxControls.Support.Sgml.SgmlReader.ParseStartTag(Char ch)
at FreeTextBoxControls.Support.Sgml.SgmlReader.ParseTag(Char ch)
at FreeTextBoxControls.Support.Sgml.SgmlReader.Read()
at System.Xml.XmlWriter.WriteNode(XmlReader reader, Boolean defattr)
at FreeTextBoxControls.Support.Formatter.HtmlToXhtml(String input)
0
chris081 Messages postés 90 Date d'inscription mercredi 24 décembre 2008 Statut Membre Dernière intervention 4 février 2009
17 janv. 2009 à 18:02
Salut

Je crois que c'est pas la premiere fois que tu demandes de l'aide a ce sujet. Je te donnes ce qui suit, et tu me dis si ca fonctionne selon tes attentes.

import java.applet.Applet;

import java.awt.Button;

import java.awt.event.ActionListener;

import java.awt.event.ActionEvent;


public class MonApplet extends Applet implements ActionListener {

Button b; // package java.awt

Process p; // package java.lang

public void init(){

this.b = new Button ("Demarrer Applet");

} // fin init


public void actionPerformed (ActionEvent ae){

Runtime r = Runtime.getRuntime();

// la String suivante fonctionne sous Win98.

// Tout ce qu'elle fait, c'est qu'elle contient

// un path vers le shell systeme. A remplacer

// selon tes besoins.

String commande = "c:\\windows\\command.com /c appletviewer Applet2.htm";

this.p = r.exec (commande);

// ici, avec this.p, tu peux manipuler ton objet
// Process, retourné par Runtime.exec(String).
} // fin actionPerformed (ActionEvent)
public void start(){

// ici, tu places le code pour le bouton, ses dimenisons, position sur le layout, etc...
this.b.addActionListener (this);
add (this.b);

} // fin start


} // fin MonApplet

J'espere que ca reponds a ta question. Sinon, tu n'hesite pas a demander.

chris081

p.s.: Pour plus d'infos, voit les liens vers la javadoc online suivant: Process, Runtime
0
Rejoignez-nous