votako

hm

Nov 21st, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. import util.Print.*;
  2. import javax.swing.*;
  3. import java.awt.*;
  4.  
  5. class Room{
  6.     private int width;
  7.     private int height;
  8.  
  9.     public Integer getWidth(){
  10.         return this.width;
  11.     }
  12.     public void setWidth(int width){
  13.             this.width=width;
  14.     }
  15.  
  16.     public Integer getHeight(){
  17.         return this.height;
  18.     }
  19.     public void setHeight(int height){
  20.             this.height = height;
  21.     }
  22. }
  23.  
  24. public class Run{
  25.     public static void main(String[] args) {
  26.         Room room = new Room();
  27.         room.setHeight(12);
  28.         room.setWidth(9);
  29.  
  30.         JFrame frame = new JFrame();
  31.         frame.setSize(room.getHeight(), room.getWidth());
  32.  
  33.         frame.setUndecorated(false);
  34.         frame.setVisible(true);
  35.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  36.         frame.setResizable(false);
  37.         frame.setLocation(100,100);
  38.  
  39.         Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  40.         frame.setSize(screenSize);
  41.         frame.setExtendedState(Frame.MAXIMIZED_BOTH);
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment