mainerimiina

Game

Oct 5th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package com.maineri.mainepix;
  2.  
  3. import java.util.Random;
  4. import javax.swing.JFrame;
  5.  
  6. public class Game {
  7.  
  8. static JFrame frame;
  9.  
  10. static String[] myStringArray = new String[]{
  11. "\"Bankruptcy is bad!\"", //Work
  12. "\"Money doesn't make happy!\"", //Work
  13. "\"The World needs butterfields...\"", //Work
  14. "\"Made by Maineri\"", //Work
  15. "\"Send feedback to ********\"", //Work
  16. "\"World is horrible place!\"", //Work
  17. "\"Java Programming is good hobby!\"", //Work
  18. "\"Finland is wonderful place!\"", //Work
  19. "\"Please try this game!\"" //Work
  20. };
  21.  
  22.  
  23. public static final int WIDTH = 600;
  24. public static final int HEIGHT = 400;
  25.  
  26. public static void main(String[] args) {
  27.  
  28. GamePanel gp;
  29.  
  30. int max = 10;
  31. int min = 1;
  32.  
  33. Random rand = new Random();
  34.  
  35. int RandomNum = rand.nextInt(max - min);
  36.  
  37. frame = new JFrame("Business Game - " + myStringArray[RandomNum]);
  38. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  39. frame.setResizable(false);
  40. frame.add(gp = new GamePanel());
  41. frame.pack();
  42. frame.setLocationRelativeTo(null);
  43. frame.setSize(WIDTH, HEIGHT);
  44. frame.setVisible(true);
  45.  
  46. }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment