Hey guys I’m creating a game similar to farmville in java and I’m just wondering how would I implement the interactive objects/buttons that the user would usually click to interact with the game client.
I do not want to use the swing library (generic windows looky likey objects), I would like to import custom images for my buttons and assign button like properties to those images which would be used for the GUI.
Any advice? Any pointers? I can’t seem to find that information through youtube or some other java gaming sites as they’re only showing simple example using swing.
Any help would be deeply appreciated thanks!
Regards
Gareth
You can use JButton, just override the
paintfunction. and draw what ever you want there. It takes a while until you get it at the first time how this works. I recommend you to read a little about theevent-dispatching thread(here is java’s explanation)And here is some code that I wrote so you have a simple reference.