Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement