Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import util.Print.*;
- import javax.swing.*;
- import java.awt.*;
- class Room{
- private int width;
- private int height;
- public Integer getWidth(){
- return this.width;
- }
- public void setWidth(int width){
- this.width=width;
- }
- public Integer getHeight(){
- return this.height;
- }
- public void setHeight(int height){
- this.height = height;
- }
- }
- public class Run{
- public static void main(String[] args) {
- Room room = new Room();
- room.setHeight(12);
- room.setWidth(9);
- JFrame frame = new JFrame();
- frame.setSize(room.getHeight(), room.getWidth());
- frame.setUndecorated(false);
- frame.setVisible(true);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setResizable(false);
- frame.setLocation(100,100);
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- frame.setSize(screenSize);
- frame.setExtendedState(Frame.MAXIMIZED_BOTH);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment