package Tools;public class Eingabe{ public static double inDouble(String text){ double wert=0; try{ wert=Double.parseDouble(text); }catch (NumberFormatException nfe){ MeldeDlg dlg = new MeldeDlg ("Fehleingabe",nfe.getMessage()+": Bitte nur Zahlen eigeben!"); dlg.setVisible(true); //MeldeDlg ! } return wert; }}package Tools;import java.awt.*;import java.awt.event.*;public class MeldeDlg extends Frame { // Anfang Variablen String labelText; Label lb = new Label(); Button bu = new Button(); // Ende Variablen public MeldeDlg (String Title, String lT) { // Frame-Initialisierung super (Title); this.labelText=lT; addWindowListener(new WindowAdapter() { public void windowClosing (WindowEvent evt) {dispose();}}); this.setSize(300, 150); this.setLocation(200,200); this.setBackground(Color.lightGray); this.setLayout(null); // Anfang Komponenten lb.setBounds(15,50,270,25); lb.setAlignment(Label.CENTER); lb.setText(labelText); lb.setBackground(Color.lightGray); lb.setFont(new Font("Courier", 1, 12)); lb.setForeground(Color.blue); this.add(lb); bu.setBounds(115,100,70,25); bu.setLabel("OK"); bu.setFont(new Font("Courier", 1, 12)); this.add(bu); bu.addActionListener (new ActionListener () { public void actionPerformed (ActionEvent evt) { buActionPerformed (evt);}}); // Ende Komponenten } // Anfang Ereignisprozeduren public void buActionPerformed (ActionEvent evt) { dispose(); } }