@@ -66,6 +66,7 @@ public class AndroidUtil {
6666
6767 // Creates a message dialog, where the text can contain clickable links.
6868 static public void showMessage (String title , String text ) {
69+ System .out .println (text );
6970 if (title == null ) title = "Message" ;
7071 if (Base .isCommandLine ()) {
7172 System .out .println (title + ": " + text );
@@ -76,17 +77,26 @@ static public void showMessage(String title, String text) {
7677 "margin: " + TEXT_MARGIN + "px; " +
7778 "width: " + TEXT_WIDTH + "px }" +
7879 "</style> </head>" +
79- "<body> <p>" + text + "</p> </body> </html>" ;
80- JEditorPane pane = new JEditorPane ("text/html" , htmlString );
80+ "<body> <p>" + text + "</p> </body> </html>" ;
81+ JEditorPane pane = new JEditorPane ();
82+ pane .setContentType ("text/html" );
83+ pane .setText (htmlString );
84+ pane .setEditable (false );
85+
8186 pane .addHyperlinkListener (new HyperlinkListener () {
8287 @ Override
8388 public void hyperlinkUpdate (HyperlinkEvent e ) {
8489 if (e .getEventType ().equals (HyperlinkEvent .EventType .ACTIVATED )) {
85- Platform .openURL (e .getURL ().toString ());
90+ if (e .getURL () != null ) {
91+ Platform .openURL (e .getURL ().toString ());
92+ } else {
93+ String description = e .getDescription ();
94+ System .err .println ("Cannot open this URL " + description );
95+ }
8696 }
8797 }
8898 });
89- pane . setEditable ( false );
99+
90100 JLabel label = new JLabel ();
91101 pane .setBackground (label .getBackground ());
92102 JOptionPane .showMessageDialog (null , pane , title ,
0 commit comments