Is there a built-in feature to make a Swing JButton audible. I am interested in a click or beep sound. I know I can invoke noise making code in the event handler, but I am specifically inquiring about any built-in capability that only needs to be enabled.
Share
No, Swing is only about gui. I think there isn’t any built-in feature like that. You should add an action listener to your JButton and handle that feature inside actionPerformed method.
For what concern audio playback you can have a look at java sound api.