Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.felix.pack;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- public class Window extends JFrame {
- JFrame frame;
- int width;
- int height;
- String title;
- MainPane mainpane;
- public Window(int width, int height, String title){
- frame = new JFrame();
- this.width = width;
- this.height = height;
- this.title = title;
- frame.setSize(width, height);
- frame.setResizable(false);
- frame.setLocationRelativeTo(null);
- frame.setTitle(title);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- public Window(){
- mainpane = new MainPane();
- }
- public void setPanel(JPanel pane){
- frame.add(pane);
- frame.setContentPane(pane);
- frame.pack();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment