Java Case: Swing Lottery

1. Operation effect

  • Click the [Start] button to start the lottery, and click [Stop] to generate the winning numbers.
    insert image description here

Second, the knowledge points involved

  1. choose structure
  2. loop structure
  3. JFrame window class
  4. JPanel panel class
  5. JLabel label class
  6. JButton button class
  7. Random random class
  8. Thread thread class
  9. event handling mechanism

3. Implementation steps

(1) Create a Java project

  • Create Java Project - LotteryMachine

Guess you like

Origin blog.csdn.net/howard2005/article/details/124212289