public Container() { initGui(); } void initGui(){ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 600, 600); contentPane = new JPanel(); contentPane.setBackground(Color.LIGHT_GRAY); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGap(0, 574, Short.MAX_VALUE) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGap(0, 551, Short.MAX_VALUE) ); contentPane.setLayout(gl_contentPane); this.addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent ev) { formWindowOpened(ev); } }); windowPosition(); } private void formWindowOpened(WindowEvent e){ panelMenu=new MainMenu(); this.getContentPane().add(panelMenu); panelMenu.setVisible(true); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)