JOptionPane.showConfirmDialog(this,
message,
"title",
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE);
Die Nachricht kann 10 Zeilen und Nachricht 500 Zeilen sein. Es ändert sich dynamisch. Ich möchte eine Bildlaufleiste implementieren, wenn die Nachricht die Bildschirmhöhe überschreitet.JOptionPane.showConfirmDialog erlischt Bildschirm, wenn die Nachricht groß ist
Also habe ich versucht:
JTextArea textArea = new JTextArea (message);
JscrollPane scrollPane = new JScrollPane(textArea,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JOptionPane.showConfirmDialog(this,
scrollPane,
"title",
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE);
Dies öffnet einen Dialog und eine Bildlaufleiste in Windows und es funktioniert gut, aber in Mac-OS den Dialog geht aus dem Bildschirm.
Kann mir jemand helfen?