MainFrame.java 728 B

123456789101112131415161718192021222324
  1. package frames;
  2. import javax.swing.JFrame;
  3. import javax.swing.JPanel;
  4. @SuppressWarnings("serial")
  5. public class MainFrame extends JFrame{
  6. public MainFrame(JPanel panel){
  7. if(System.getProperties().getProperty("os.name").equals("Mac OS X")) {
  8. System.setProperty("apple.laf.useScreenMenuBar", "true");
  9. System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Test");
  10. }
  11. this.add(panel);
  12. this.setResizable(true);
  13. this.setBounds(100,100,1440,900);
  14. this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  15. this.setUndecorated(false);
  16. this.setJMenuBar(new MenuBar());
  17. this.setVisible(true);
  18. }
  19. }