Home > Back-end >  Play sound when JLabel "content" changes
Play sound when JLabel "content" changes

Time:12-20

I am currently scripting a pager application that sends out an alarm.

Now, there I have multiple JLabels and the JLabel text is set via a connection to my database (via jLabel.setText()...).

What I want to achieve is that every time the JLabel content (by JLabel.setText() ) is being updated, an alarm SoundEffect is going off.

Any ideas how I could "detect" this change of JLabel value or content?

I am using the NetBeans IDE 8.2.

CodePudding user response:

Thank you for your answers,

I ended up calling a method to play the sound together with the jLabel.setText() method

  • Related