import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class InitialProject { JFrame frame; public InitialProject() { frame = new JFrame("MENU"); frame.setSize(800, 500); frame.setLayout(new BorderLayout()); frame.add(new JButton("CVR RESTAURANT"), BorderLayout.NORTH); JPanel panel = new JPanel(); panel.add(new JButton("CONFIRM")); panel.add(new JButton("RESET")); panel.add(new JButton("EXIT")); frame.add(panel, BorderLayout.SOUTH); //frame.add(new JLabel("Border Layout West"), BorderLayout.WEST); // frame.add(new JTextField(20), BorderLayout.NORTH); frame.add(new JTextField(30), BorderLayout.WEST); frame.add(new JTextField(30), BorderLayout.EAST); frame.add(new JButton(""), BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } public static void main(String[] args) { new BorderLayoutDemo(); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter