JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / src / jalview / gui / JvSwingUtils.java
index 65be457..052c314 100644 (file)
@@ -64,11 +64,6 @@ public final class JvSwingUtils
     ttext = ttext.trim();
     boolean maxLengthExceeded = false;
 
-    /*
-     * Split into lines if already separated by <br> tags.
-     * 
-     * TODO what about </br>, <br/>, <br /> ?
-     */
     if (ttext.contains("<br>"))
     {
       String[] htmllines = ttext.split("<br>");
@@ -91,9 +86,10 @@ 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></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>" : ""));
+
   }
 
   public static JButton makeButton(String label, String tooltip,