Does anyone have an example of a slot machine in Java using swing?

I want to get some examples about the graphical interface of a slot machine written in java, I know that this is some specific thing, but I want to know if some animations can be done using java swing or something like that, hello

+2
source share
2 answers

This is not a slot machine simulator, but you can find related functions in this.

Appendix: The example cited uses Unicode characters for a change, but another trick is to implement the Icon , which works great with some components. This example decorates JButton for use in the game, and this example extends the JLabel child to display the table.

+1
source

This will not answer your question exactly (because I don't have a direct example), but I hope he at least tells you that this is possible.

I made some games using Java and Swing. None of them were too heavy for the animation. Most of the animations that I did were implemented through 2D 2D graphics libraries, while more and more interface elements happened through Swing.

For example, you can use all the functions of JButton, but override the paintComponent(Graphics g) method to make it look as you want. It was really useful in past projects for me.

The most graphically dependent game I've ever created was "Who Wants to Be a Millionaire?" the game. I used animation, graphics and sounds and that’s all, so I can assure you that this is possible, but it is certainly not as simple as some other libraries.

If you decide to continue this, I found that Swing Hacks has some useful tips on how to do weird things with Swing. Although this is not focused on games, I found interesting enough things you can do (drag and drop, lots of weird things) to make it a worthy purchase.

+1
source

All Articles