I am practicing using GUIs. I have been following a set of instructions however when I try to run the program only an empty frame appears. No information can be seen inside the frame.
here is the code I have:
package practice528;
import java.util.Scanner;
import java.io.*;
import javax.swing.*;
import java.awt.*;
public class Practice528
{
public static void main(String[] args)
{
JFrame frame = new JFrame("Rectangle Calculator");
frame.setVisible(true);
frame.setSize(400,300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel lengthL, widthL, areaL, perimeterL;
lengthL = new JLabel("Enter the length: ", SwingConstants.RIGHT);
widthL = new JLabel("Enter the width: ", SwingConstants.RIGHT);
areaL = new JLabel("The area is ", SwingConstants.RIGHT);
perimeterL = new JLabel("The perimeter is ", SwingConstants.RIGHT);
frame.setLayout(new GridLayout(5,2));
System.out.println();
} //end main
} //end class