Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-3900

Running the Jalview JAR in a web browser using webswing



    • Type: Story
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 2.11.2
    • Fix Version/s: None
    • Component/s: gui
    • Labels:


      Whilst looking at customisation of FlatLaf (JAL-3416) https://www.formdev.com/flatlaf/ I came across something called webswing https://www.webswing.org/ which purports to run Java swing applications in a web browser:
      "Webswing is a web server that allows you to run any Java Swing application inside your web browser, using only pure HTML5."

      This worked to a certain extent without much configuration effort and using only the executable jar (obtained with gradle shadowJar). It would probably work from the dist/*.jar files (obtained with gradle makeDist).

      Download the BIN .zip file for the latest version (21.1.5 at time of writing) from https://www.webswing.org/downloads .

      Unzip that into a dir and cd into it.

      Make a dir apps/Jalview and copy the executable jar into it.
      Copy a jalview logo png file into the apps/Jalview dir as icon.png.

      Add the following section to the (JSON) webswing.config file (this was just a minimally adapted copy of the "/flatlaf" section already there.

        "/jalview" : {
          "path" : "/jalview",
          "webFolder" : "",
          "security" : {
            "module" : "INHERITED",
            "classPath" : [ ]
          "icon" : "${webswing.rootDir}/apps/Jalview/icon.png",
          "langFolder" : "${webswing.configDir}/lang",
          "swingConfig" : {
            "jreExecutable" : "${java.home}/bin/java",
            "javaVersion" : "${java.version}",
            "vmArgs" : "-Xmx128m -DauthorizedUser=${user} -Dwebswing.optimizeCaret=true",
            "classPathEntries" : [ "${webswing.rootDir}/apps/Jalview/*.jar" ],
            "theme" : "Murrine",
            "fontConfig" : { },
            "swingSessionTimeout" : 300,
            "isolatedFs" : true,
            "debug" : true,
            "javaFx" : false,
            "javaFxClassPathEntries" : [ ],
            "directdraw" : true,
            "compositingWinManager" : true,
            "allowDelete" : true,
            "allowDownload" : true,
            "allowAutoDownload" : true,
            "allowUpload" : true,
            "allowJsLink" : true,
            "jsLinkWhitelist" : [ "org.webswing.demo.jslink.JsLinkDemo.*" ],
            "launcherType" : "Desktop",
            "launcherConfig" : {
              "mainClass" : "jalview.bin.Jalview"
            "userDir" : "${user}",
            "transparentFileSave" : true,
            "clearTransferDir" : true,
            "transparentFileOpen" : true,
            "transferDir" : "${user}/upload",
            "homeDir" : "${webswing.rootDir}/apps/Jalview"
          "maxClients" : 100,
          "allowStealSession" : true,
          "name" : "Jalview",
          "autoLogout" : true,
          "sessionMode" : "CONTINUE_FOR_BROWSER",
          "uploadMaxSize" : 5,
          "webHomeDir" : "${webswing.rootDir}/apps/Jalview"

      Then run
      java -jar webswing-server.war
      and then go to http://localhost:8080/jalview/ in a browser.
      Log in with user "admin" and password "pwd" and then click on the Jalview icon.

      Most obvious failings is titlebar drag and drop/resize of the the internal windows.
      However, At least some of the Fetch Sequences work (e.g. from PFAM -- the text box does not appear but you can click on "Example" and then "OK"), and some of the Web Services work (e.g. Alignment -> MafftWS with defaults) without any further configuration or code changes.

      Whilst source code is available (to registered users), I don't think this is free-to-use in any production environment. I can't immediately see any pricing on the website.

      I don't know if this is of any use, but thought it should be noted.




            jprocter Jim Procter
            soares Ben Soares
            0 Vote for this issue
            1 Start watching this issue