ShippingContainer.java
1    /* 
2     *Finding the distance 
3     */
4    
5    package shapes;
6    import javax.swing.JOptionPane;
7    
8    
9    public class ShippingContainer {
10       public static void main(String[] args) {
11           Integer height= Integer.valueOf(JOptionPane.showInputDialog(null, "Height?"));
12           System.out.println( "Height = " +height );
13   
14           Integer length = Integer.valueOf(JOptionPane.showInputDialog(null, "Length?"));
15           System.out.println( "Length = " + length );
16   
17           Integer width = Integer.valueOf(JOptionPane.showInputDialog(null, "Width?"));
18           System.out.println( "Width = " + width );
19   
20           SRectangle face = new SRectangle (height,width);
21           double key = face.diagonal();
22   
23           System.out.println("Face = " + face);
24   
25           SRectangle distance = new SRectangle (key,length);
26           double key1 = distance.diagonal();
27   
28           System.out.println(" distance = " + key1);
29   
30   
31       }
32   }