Import java.awt. *; import java.awt.event. *; import javax.swing. *;
Class JF {
Private jframe f = new jframe ("a small program"); private jlabel l1 = new jlabel (" "); private jlabel l2 = new jlabel ("="); private jtextfield t1 = new jtextfield ("0.0"); Private JTextField T2 = New JtextField ("0.0"); Private JButton B = New JButton ("add"); public jf () {f.getContentPane (). setLayout (New flowLayout ()); f.getContentPane (). Add (T1); F.GetContentPane (). add (l1); f.getContentPane (). Add (t2); f.getContentPane (). add (l2); f.getContentPane (). add (b); f. Setsize (200,100); f.setVisible (TRUE); B.AddActionListener (New ActionListener () {public void actionPerformed (ActionEvent E) {float a1 = float.Parsefloat (t1.gettext ()); float a2 = float.parsefloat T2.Gettext (); float a3 = a1 a2; l2.settext ("=" a3);}}; f.addwindowlistener (new windowadapter () {public void windowclosing (WindowEvent E) {system.exit 0);}});} public static void ma in (String [] args) {new jf ();}}