//Eric Bauer //Homework #11 Exercise 6.24 //this is an applet that will prompt the user to enter three floating //point numbers, and then tell the user in the statua bar which was //the lowezt of the three import javax.swing.*; import java.awt.event.*; import java.awt.*; public class Minimum3 extends JApplet implements ActionListener{ JLabel numL1,numL2,numL3; JTextField num1,num2,num3; public void init() { Container c=getContentPane(); c.setLayout(new FlowLayout()); numL1=new JLabel("Enter a floating point number here:"); c.add(numL1); num1=new JTextField(10); c.add(num1); numL2=new JLabel("Enter a floating point number here:"); c.add(numL2); num2=new JTextField(10); c.add(num2); numL3=new JLabel("Enter a floating point number here:"); c.add(numL3); num3=new JTextField(10); num3.addActionListener(this); c.add(num3); }//end method init public void actionPerformed(ActionEvent e) { float nums1,nums2,nums3; float result; int x; showStatus("Calculating..."); nums1=Float.parseFloat(num1.getText()); nums2=Float.parseFloat(num2.getText()); nums3=Float.parseFloat(num3.getText()); result=minimum3(nums1,nums2,nums3); showStatus("The smallest value is "+ Float.toString(result)); }//end actionPerformed public float minimum3 (float x, float y, float z) { return(Math.min(Math.min(x,y),z)); }//end method minimum3 }//end class Minimum3