Hey all, I am working on a simple game just for fun and practice. I already have a way to make "buttons" in-game but I was wondering if there was a better way of doing it. Currently to do buttons I draw text to the game, make a rectangle that is the size of the text, then I make a class that extends MouseAdapter and add it to my JPanel using addMouseListener(). In the class that extends MouseAdapter I have a mousePressed() method that checks if the click is inside the button's rectangle and acts accordingly. Is there a better/easier/simpler way to do this? Thanks in advance for any help
