I am creating a GUI that presents information. I want to get the borders together and not be apart as the compiled code shows. Also, I want them to be equal length(so that lines four and two will be matched in length with 1 and 3 by adding empty space and have a box borderline around it. Can someone please help?
Java Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;


public class Exercise12_05 extends JFrame{
	
	private JLabel label1,label2,label3,label4;
	
	public Exercise12_05()
	{
		JPanel panel = new JPanel(new GridLayout(4,1,0,0));
		panel.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
		label1 = new JLabel("Department of Computer Science");
		label1.setBorder(new LineBorder(Color.BLACK,2));
		label2 = new JLabel("School of Computing");
		label2.setBorder(new LineBorder(Color.BLACK,2));
		label3 = new JLabel("Armstrong Atlantic State University");
		label3.setBorder(new LineBorder(Color.BLACK,2));
		label4 = new JLabel("Tel: (912)921-6440");
		label4.setBorder(new LineBorder(Color.BLACK,2));
		add(label1);
		add(label2);
		add(label3);
		add(label4);
		setLayout((new FlowLayout(FlowLayout.LEFT)));
	}
	
	public static void main(String[]args)
	{
		Exercise12_05 frame = new Exercise12_05();
		frame.setTitle("Execise 12_5");
		frame.setSize(200,300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
	}
}