Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 2nd, 2012  |  syntax: None  |  size: 0.93 KB  |  views: 43  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package game.project;
  2.  
  3. import javax.swing.JFrame;
  4.  
  5. public class MainJFrameConfig {
  6.        
  7.         public static JFrame Jf = new JFrame();
  8.         public static int UWidthTest = Jf.getContentPane().getWidth()-50;
  9.         public static int UHeightTest = Jf.getContentPane().getHeight()-50;
  10.         public static void JFrameSize(){
  11.                
  12.                 int UWidth = Jf.getContentPane().getWidth();
  13.                 int UHeight = Jf.getContentPane().getHeight();
  14.                 System.out.println("| Width: " + UWidth + " | Height: " + UHeight + " | Time: " + MainGameLoop.TimeElapsed + " |");
  15.                
  16.         }
  17.        
  18.         public MainJFrameConfig(){
  19.                
  20.                 Jf.setTitle(MainClassHandler.Title);
  21.                 Jf.setExtendedState(JFrame.MAXIMIZED_BOTH);
  22.                 Jf.setResizable(true);
  23.                 Jf.setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width-50,
  24.                          java.awt.Toolkit.getDefaultToolkit().getScreenSize().height-100);
  25.                 Jf.setLocationRelativeTo(null);
  26.                 Jf.setVisible(true);
  27.                 Jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  28.                
  29.         }
  30.        
  31. }