import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JFrame;
public class MainGUI extends JFrame implements ActionListener
{
private JPanel panel = new JPanel();
private JFrame mainFrame = new JFrame();
private JTextField tekstfelt = new JTextField(100);
private JButton knap = new JButton("Beregn");
public MainGUI()
{
knap.addActionListener(this);
panel.add(tekstfelt);
panel.add(knap);
mainFrame.add(panel);
show();
}//end mainGUI()
public void actionPerformed(ActionEvent e)
{
if (e.getSource()==knap)
{
Double d = Double.parseDouble(tekstfelt.getText());
//eller;
//String s = tekstfelt.getText();
}//end if
}//end actionPerformed
}//end class
--
"Sic gorgiamus allos subjectatos nunc"
Lars 'Trygleren' Winther
www.hesteskelet.dk/newsgroup