I need to write a Java program to display a screen like the following screen, which uses the BorderLayout.
This is what my output is supposed to be:
Untitled1.png or View Here: https://www.dropbox.com/s/u1pqz588b8cofxo/Untitled1.png
I tried writing the code for this program. But I am not able to do so. Following is my code:
import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; public class GUI extends JFrame { public GUI() { setLayout(new BorderLayout(1000,2000)); add(new JButton("Java"), BorderLayout.NORTH); add(new JButton("Programming"), BorderLayout.CENTER); add(new JButton("Is Not So Easy"), BorderLayout.NORTH); add(new JButton("Linear Data Structers!"), BorderLayout.SOUTH); } public static void main(String[] args) { GUI frame = new GUI(); frame.setTitle("EECS 1570"); frame.setSize(600,400); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
Please can you help me get the output like the one in the attached picture file? Thanks for your help. Much appreciated!