Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tarekeselotto;
- import java.awt.GridLayout;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- /**
- *
- * @author isonuZ
- */
- public class LottoWheel extends JFrame {
- public Ball[] balls = new Ball[7];
- int[] result = new int[7];
- public LottoWheel() {
- initBalls();
- setLayout(new GridLayout(1, 8));
- for(int i=0; i < 6; i++) {
- add(balls[i]);
- }
- add(new JLabel(" "));
- add(balls[6]);
- for(int i=0; i<balls.length; i++) {
- result[i] = balls[i].getValue(result, i);
- }
- for(int r : result) {
- System.out.print(r + " ");
- }
- }
- public static void main(String[] args) {
- LottoWheel frame = new LottoWheel();
- frame.setLocationRelativeTo(null); // Center the frame
- frame.setSize(600, 80); //w, h
- frame.setVisible(true);
- }
- private void initBalls() {
- for(int i=0; i < balls.length; i++) {
- balls[i] = new Ball();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement