Adds a screen reader accessible label to the mute button. Label toggles between mute and unmute to match the action that will be taken when the button is next pressed.

This commit is contained in:
Rachel Olivero
2017-02-03 10:19:52 -05:00
parent 26087c465f
commit 952d930b5b

View File

@@ -383,6 +383,7 @@ public class AudioPanel extends JPanel implements Listener<AudioEvent>
{
setIcon(UNMUTED_ICON);
setBorderPainted(false);
getAccessibleContext().setAccessibleName("Mute");
addActionListener(new ActionListener()
{
@@ -402,6 +403,7 @@ public class AudioPanel extends JPanel implements Listener<AudioEvent>
public void run()
{
setIcon(mMuted ? MUTED_ICON : UNMUTED_ICON);
getAccessibleContext().setAccessibleName(mMuted ? "Unmute" : "Mute");
}
});
}