caption: Adding all labels, text fields and buttons to the container
exif: {"Image DocumentName": "Adding all labels, text fields and buttons to the container", "Image ImageDescription": "// MiniCalc.java - demo gridlayout. import java.awt. ; import javax.swing. ; class MiniCalc{ public static void main (String[] args){ JFrame frame = new JFrame( MiniCalc ); Container pane = frame.getContentPane(); //Creating the major components. JTextField firstNumber= new JTextField(20); JTextField secondNumber= new JTextField(20); JTextField result= new JTextField(20); JButton addButton = new JButton( Add ); JButton subButton = new JButton( Subtract ); pane.setLayout(new GridLayout(4,2)); pane.add(new JLabel( Enter a number )); pane.add(firstNumber); pane.add(secondNumber); pane.add(new JLabel( Result )); pane.add(result); pane.add(addButton); pane.add(subButton); DoMath listener = new DoMath(firstNumber, secondNumber, result); subButton.addActionListener(listener); addButton.addActionListener(listener); frame.pack(); frame.show(); } Adding all labels, text fields and buttons to the container.", "Image XResolution": "200", "Image YResolution": "200", "Image ResolutionUnit": "Pixels/Inch", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}