This simple program rolls two dice.
Tutorial Details:
It is divided into three source files.
* RollDice.java is both an application (it defines main()) and an applet (it subclasses JApplet).
* RollDicePanel.java is a subclass of JPanel that creates the GUI interface.
* Die.java defines a component as a subclass of JPanel, and provides a graphical view of the die face. It implements logic with a roll() method that randomly "rolls" the die.
Rate Tutorial: http://www.roseindia.net/java/java-tips/45examples/30graphics/40roll_dice/10roll_dice.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Java: Example - Rolling Dice
View Tutorial: Java: Example - Rolling Dice
Related
Tutorials:
|