You'll find a
tutorial on event handling here, which ultimately has JButtons within JFrames for you to review. However, any text editor will do when you're coding something up, in the process - you'll learn more.
Start with any good tutorial and an editor of your choice, and you'll be on your way.