Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void mainMenu()
- {
- JPanel menuDisplay=new JPanel();
- menuDisplay.setLayout(new BoxLayout(menuDisplay,BoxLayout.Y_AXIS));
- menuDisplay.setBackground(Color.white);
- JLabel menuTitle=new JLabel("Property Rental Appliance Inventory");
- menuTitle.setAlignmentX(Component.CENTER_ALIGNMENT);
- menuTitle.setFont(new Font("Calibre", Font.BOLD, 45));
- JLabel subTitle=new JLabel("Main Menu");
- subTitle.setAlignmentX(Component.CENTER_ALIGNMENT);
- subTitle.setFont(new Font("Calibre", Font.BOLD, 30));
- int buttonSizeHeight=70;
- int buttonSizeWidth=400;
- int buttonFontSize=25;
- JButton navByLoc=new JButton("Navigate By Location");
- navByLoc.setAlignmentX(Component.CENTER_ALIGNMENT);
- navByLoc.setFont(new Font("Title", Font.BOLD, buttonFontSize));
- size(navByLoc,buttonSizeWidth,buttonSizeHeight);
- JButton advSearch=new JButton("Advanced Search");
- advSearch.setAlignmentX(Component.CENTER_ALIGNMENT);
- advSearch.setFont(new Font("Title", Font.BOLD, buttonFontSize));
- size(advSearch,buttonSizeWidth,buttonSizeHeight);
- JButton genStats=new JButton("General Statistics");
- genStats.setAlignmentX(Component.CENTER_ALIGNMENT);
- genStats.setFont(new Font("Title", Font.BOLD, buttonFontSize));
- size(genStats,buttonSizeWidth,buttonSizeHeight);
- JButton backOpt=new JButton("Backup Options");
- backOpt.setAlignmentX(Component.CENTER_ALIGNMENT);
- backOpt.setFont(new Font("Title", Font.BOLD, buttonFontSize));
- size(backOpt,buttonSizeWidth,buttonSizeHeight);
- fill(menuDisplay,15);
- menuDisplay.add(Box.createVerticalGlue());
- menuDisplay.add(menuTitle);
- fill(menuDisplay,10);
- menuDisplay.add(subTitle);
- fill(menuDisplay,40);
- menuDisplay.add(navByLoc);
- fill(menuDisplay,80);
- menuDisplay.add(advSearch);
- fill(menuDisplay,80);
- menuDisplay.add(genStats);
- fill(menuDisplay,80);
- menuDisplay.add(backOpt);
- fill(menuDisplay,200);
- mainFrame.add(menuDisplay,BorderLayout.NORTH);
- showFrame();
- }
- public void fill(JPanel k, int x) //creates a vertical fill space for box layout
- {
- k.add(Box.createRigidArea(new Dimension(1, x)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement