JAL-3253-applet JAL-3360 HTML tooltips not trimming properly; need <div>
[jalview.git] / src / jalview / gui / JvSwingUtils.java
index 4658668..c1c8c82 100644 (file)
@@ -61,7 +61,8 @@ public final class JvSwingUtils
    * style class specifying word-wrap and break-word
    * 
    * @param enclose
-   *          if true, add &lt;html&gt; wrapper tags
+   *          if true, add &lt;html&gt; wrapper tags (currently false for only
+   *          two references -- both in Jws2Discoverer --
    * @param ttext
    * 
    * @return
@@ -94,10 +95,12 @@ public final class JvSwingUtils
     {
       return enclose ? "<html>" + ttext + "</html>" : ttext;
     }
-
-    return (enclose ? "<html>" : "")
-            + "<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
-            + ttext + "</p>" + ((enclose ? "</html>" : ""));
+    // BH 2018,2019
+    return (enclose
+            ? "<html><div style=\"width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;\">"
+            + ttext
+                    + "</div></html>"
+            : ttext);
 
   }