Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.Toolkit;
- import java.awt.Dimension;
- class SlotMachine
- {
- public static void main(String[] args)
- {
- JFrame window = new JFrame();
- window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- window.setTitle("Slots!");
- window.setSize(200,200);
- Toolkit toolkit = window.getToolkit();
- Dimension size = toolkit.getScreenSize();
- window.setLocation(size.width/2 - window.getWidth()/2, size.height/2 - window.getHeight()/2);
- JLabel label = new JLabel("Slot Machine v1.0");
- label.setSize(200,200);
- label.setLocation(window.getWidth()/2,window.getHeight()/2);
- window.add(label);
- window.setVisible(true);
- }
- }
Add Comment
Please, Sign In to add comment