error message is always on top

This commit is contained in:
hneemann 2017-07-07 16:35:13 +02:00
parent b454445b14
commit b05ba93ae0

View File

@ -89,9 +89,15 @@ public class ErrorMessage implements Runnable {
* @return this for call chaining
*/
public ErrorMessage show(Component parent) {
JOptionPane.showMessageDialog(parent,
new LineBreaker(120).toHTML().preserveContainedLineBreaks().breakLines(message.toString()),
Lang.get("error"), JOptionPane.ERROR_MESSAGE);
JOptionPane optionPane = new JOptionPane(
new LineBreaker(120)
.toHTML()
.preserveContainedLineBreaks()
.breakLines(message.toString()),
JOptionPane.ERROR_MESSAGE);
JDialog dialog = optionPane.createDialog(parent, Lang.get("error"));
dialog.setAlwaysOnTop(true);
dialog.setVisible(true);
return this;
}