Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. import java.awt.*;
  2. import java.io.*;
  3. import javax.swing.*;
  4. import javax.imageio.ImageIO;
  5.  
  6. public class gameOver {
  7.  
  8. public static void game() {
  9.  
  10. //Frame
  11. JFrame f = new JFrame("Coudrado");
  12. f.setSize(910, 910);
  13. f.setLocationRelativeTo(null);
  14. f.setResizable(false);
  15. f.setVisible(true);
  16. try {
  17. f.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("gameOver.jpg")))));
  18. } catch (IOException e) {
  19. e.printStackTrace();
  20. }
  21. f.pack();
  22.  
  23. Font fontButton = new Font("Arial", Font.BOLD, 27);
  24. Color pink = new Color(254,94,120);
  25.  
  26. Button b = new Button("Restart");
  27. b.setBounds(355,750, 200, 75);
  28. b.setFont(fontButton);
  29. b.setBackground(pink);
  30. b.setVisible(true);
  31. f.add(b);
  32.  
  33.  
  34.  
  35.  
  36. Font fontText = new Font("Arial", Font.BOLD, 60);
  37. Label l1 = new Label("Score: 65");
  38. l1.setBounds(205, 550, 500, 75);
  39. l1.setVisible(true);
  40. l1.setFont(fontText);
  41. f.add(l1);
  42.  
  43. Label l2 = new Label("Highscore: 125");
  44. l2.setBounds(205, 650, 500, 75);
  45. l2.setVisible(true);
  46. l2.setFont(fontText);
  47. f.add(l2);
  48.  
  49.  
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement