Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.io.*;
- import javax.swing.*;
- import javax.imageio.ImageIO;
- public class gameOver {
- public static void game() {
- //Frame
- JFrame f = new JFrame("Coudrado");
- f.setSize(910, 910);
- f.setLocationRelativeTo(null);
- f.setResizable(false);
- f.setVisible(true);
- try {
- f.setContentPane(new JLabel(new ImageIcon(ImageIO.read(new File("gameOver.jpg")))));
- } catch (IOException e) {
- e.printStackTrace();
- }
- f.pack();
- Font fontButton = new Font("Arial", Font.BOLD, 27);
- Color pink = new Color(254,94,120);
- Button b = new Button("Restart");
- b.setBounds(355,750, 200, 75);
- b.setFont(fontButton);
- b.setBackground(pink);
- b.setVisible(true);
- f.add(b);
- Font fontText = new Font("Arial", Font.BOLD, 60);
- Label l1 = new Label("Score: 65");
- l1.setBounds(205, 550, 500, 75);
- l1.setVisible(true);
- l1.setFont(fontText);
- f.add(l1);
- Label l2 = new Label("Highscore: 125");
- l2.setBounds(205, 650, 500, 75);
- l2.setVisible(true);
- l2.setFont(fontText);
- f.add(l2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement