Of course, JOptionPane.
When you are dealing with Exception, you can use this:
try { } catch (Exception e) { JOptionPane.showMessageDialog(null, e.toString(), "Error", JOptionPane.ERROR_MESSAGE); }
Or, when you just spotted your own error:
if (someList.size() == 0) { JOptionPane.showMessageDialog(null, "List contained 0 elements!", "Error", JOptionPane.ERROR_MESSAGE); }
Martijn courteaux
source share