slt a tt
je recherche un moyen d'extraire une variable java d'un applet vers une variable autre comme J# ou VB en .net.
les variables que je souhaite récupéré se trouvent dans un coupleur web embarqué dans un automate qui n'execute que du java et du html .
Serait il possible d'aller tapper directement dans un jar grace a l'ip du coupleur comme fait l'applet de la page html
exemple d'une page html
<APPLET codebase="/classes" archive="SAComm.jar"
code="com.schneiderautomation.factorycast.LiveLabelApplet"
width=300 height=30>
<PARAM name=LABEL value="Volumes">
<PARAM name=UNITS value="m/cube">
<PARAM name=ADDRESS value="%MW0">
<PARAM name=DATATYPE value="REAL">
<PARAM name=FORMAT value="DEC">
<PARAM name=BACKGRND value="RED">
<PARAM name=FOREGRND value="WHITE">
<PARAM name=FONT_NAME value="SERIF">
<PARAM name=FONT_BOLD value="TRUE">
<PARAM name=FONT_SIZE value="16">
</APPLET>
en gros cette applet me revoi la valeur du mot %MW0 de l'automate.
et voici un exemple ou je vais lire le %MW0 a partir d'une class
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import com.schneiderautomation.factorycast.*;
import com.schneiderautomation.factorycast.comm.StatusMessages;
public class applet2 extends Applet implements PropertyChangeListener
{
// controls for applet
private TextField address = new TextField( 10 );
private Button regButton = new Button( "Lecture" );
private Label valsRead = new Label();
// variables pour communication automate
private CommBean comm;
private MonitorUInt monitor;
private short qty = 1;
public void init()
{
// Récupération adresse IP de l'automate
String host = getCodeBase().getHost();
// Création des beans de communication
comm = new CommBean(getLocale());
monitor = new MonitorUInt(comm.getAdaptor());
monitor.addPropertyChangeListener(this);
regButton.addActionListener(new RegisterMonitor());
valsRead = new Label(" ");
address.setText
("%MW0");
setBackground(Color.lightGray);
// Dessin des objets à l'écran
GridBagConstraints constraints = new GridBagConstraints();
setLayout(new GridBagLayout());
constraints.anchor = GridBagConstraints.WEST;
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.gridheight = 1;
constraints.gridwidth = 1;
constraints.insets.left = 5;
constraints.insets.right = 5;
constraints.insets.top = 3;
constraints.insets.bottom = 3;
constraints.gridx = 0;
constraints.gridy = 0;
add(new Label("Addresse :"), constraints);
constraints.gridx++;
add(address, constraints);
constraints.gridx = 0;
constraints.gridy++;
constraints.gridwidth = 1;
constraints.gridy++;
add(regButton, constraints);
constraints.gridx = 0;
constraints.gridy++;
add(valsRead, constraints);
// Connexion avec l'automate et gestion de l'erreur éventuelle
try
{
comm.connect(host, false);
comm.start();
}
catch(Exception e)
{
}
}
//==================================================================
public void destroy()
{
try
{
comm.disconnect();
}
catch(Exception e)
{
}
}
//===========================================================
// Appelé à chaque nouvelle valeur recue
public void propertyChange(PropertyChangeEvent evt)
{
String prop = evt.getPropertyName();
if(prop.equals("value"))
{
Integer value = (Integer) evt.getNewValue();
valsRead.setText(value.toString());
}
}
//=====================================================
// Définition de la classe Ecouteur
class RegisterMonitor implements ActionListener
{
public void actionPerformed(ActionEvent evt)
{
monitor.setAddress(address.getText());
monitor.setQuantity(qty);
monitor.register();
}
}
}
si quelqu'un a un debut de réponse....