Whenever i show a JOptionPane in my Swing application i fire a beep before it like this :
Toolkit.getDefaultToolkit().beep();
JOptionPane.showMessageDialog( myFrame, "Message", "Title", JOptionPane.INFORMATION_MESSAGE );
Is there a way to apply the first line automatically to any JOptionPane in case i forgot to write it in code ?
You could create your own class which has a static method showMessageDialogAndBeep()
which calls JOptionPane.showMessageDialog
and beeps before.
void showMessageDialog(Component pC, Object m, String t, int mT)
{
Toolkit.getDefaultToolkit().beep();
JOptionPane.showMessageDialog( pC, m,t,mT);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With