Skip to main content

Audible sound when altering hidden UI element on unselected panel of JTabbedPane

1 reply [Last post]
theosib
Offline
Joined: 2011-09-06
Points: 0

Hi,

I'm new to Java, so I'm having a hard time tracking down an answer to this on my own. I'm writing a Java application, and I'm using Swing. I'm not sure if it's relevant, but I'm using Netbeans as my IDE on a Mac.

I've been having this problem where an audible sound would be emitted whenever my Java program was launched. I tracked it down to a setText method call to a JTextField element that happens to be on an unselected panel of a JTabbedPane. If I comment that out, the sound doesn't occur.

The reason I want to do this is so that when that panel is selected, it will appear with the correct info, which I don't know until the program has started up.

Does anyone have an idea as to why this is happening and how to disable it?

Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
theosib
Offline
Joined: 2011-09-06
Points: 0

Ah. Stupid me. It had nothing to do with being hidden. I was thoughtlessly doing this from a thread other than the event dispatch. I'm not sure why it beeped, but when I properly used invokeLater, the sound went away.