import java.awt.event.*;//import java.util.*;import java.awt.*;import java.io.*; import java.net.*;class Daten{ String name; String[] adresse = new String[3]; String telfax; String plz; String www; String zusatz; Boolean[] branche = new Boolean[3];}public class Testextends java.applet.Applet implements ItemListener,ActionListener{ Daten[] daten = new Daten[2]; List liste = new List(8); String s; URL url; static Frame f = new Frame(); TextField tf = new TextField("Suchen",20); boolean[] Status = {false,false,false}; public Test() { f.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent event) { setVisible(false); f.dispose(); System.exit(0); } }); } public void init() { setBackground(Color.white); setBounds(0,0,600,400); setLayout(null); Panel panel = new Panel(); Oberflaeche(panel); panel.setBounds(0,0,600,400); add(panel); validate(); } private void Oberflaeche(Panel panel) { Checkbox cb = new Checkbox("Gas", false); cb.addItemListener(this); panel.add(cb); cb = new Checkbox("Wasser", false); cb.addItemListener(this); panel.add(cb); cb = new Checkbox("Energie", false); cb.addItemListener(this); panel.add(cb); tf.addActionListener(this); //tf.addTextListener(this); panel.add(tf); Button test = new Button("Test"); test.addActionListener(this); test.setBounds(50,100,1,150); panel.add(test); liste.addActionListener(this); liste.setBounds(50,300,1,150); liste.addItemListener(this); panel.add(liste); } public void itemStateChanged(ItemEvent event) { Checkbox cb = (Checkbox) event.getItemSelectable(); if(cb.getLabel()=="Gas") { Status[0]=(boolean)cb.getState(); } if(cb.getLabel()=="Wasser") { Status[1]=(boolean)cb.getState(); } if(cb.getLabel()=="Energie") { Status[2]=(boolean)cb.getState(); } } public void actionPerformed(ActionEvent event) { String cmd = event.getActionCommand(); if (cmd.equals("Test")) { daten[0].name="Hallo"; daten[1].name="Fuck you"; System.out.println(daten[0].name); //System.out.println(daten[1].name); String such=tf.getText(); try { URL url = new URL(s); getAppletContext().showDocument(url); } catch(MalformedURLException malformedurlexception) { System.out.println("Fehler"); } } } public static void main( String argv[] ) { } //end of main() } // end of class