//————–Output————————–

//————Full Source Code——————
//Programmer:Akinwale Owi
//Company: Dagba Computers
//Program Purpose: GridLayout Example using JRadioButtons
package dagbacomputers;
//Imports
import java.awt.GridLayout;
import javax.swing.JRadioButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.*;
//Beginning of DagbaComputers (Class containing the Main function)
public class DagbaComputers
{
//Main Function
public static void main(String[] args)
{
//Creating the JFrame
JFrame frame = new JFrame(“Dagba Computers GridLayout Example”);
//Setting close operation
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Size of JFrame
frame.setPreferredSize(new Dimension (400, 400));
//The Dimensions of the Grid (rows, columns)
frame.setLayout(new GridLayout(2, 2));
//Adding items to the Grid
frame.add(new JRadioButton(“Spot 1”));
frame.add(new JRadioButton(“Spot 2”));
frame.add(new JRadioButton(“Spot 3”));
frame.add(new JRadioButton (“Spot 4”));
frame.add(new JLabel(“”));//I used this to create a space because
frame.add(new JRadioButton(“Spot 6”));
//Pack and Visibility
frame.pack();
frame.setVisible(true);
}
//End of Main Function
}
//End of DagbaComputers Class
//————-End of the Program—————–