Categories
Dictionnary
Download
Project Details
Changes Log
FAQ
License


javaXUL is a XUL library in Java (including Javascript capabilities), allowing to use it in Java projects.

The XUL language allows to define an UI using an XML declarative language, but also to interact with the widgets using Javascript and any other scripting language.

About XUL

Main Article: About XUL

XUL was an XML UI declarative language used by Firefox and other Mozilla products until 2017 (Firefox 57). It allowed to define a full UI with buttons, panels, text boxes, etc... in XML. See also developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL for more information.

Installation

Main Article: distribution

You only need to unzip the content of the javaXUL-bin-<version>.jar zip file anywhere. See also dependencies for the libraries dependencis of the framrwork (all provided with the binaries zip file).

Usage

To open the XUL browser, just double-click on the xulBrowser.jar jar file, or type on the command-line:

      java -jar xulBrowser.jar
Alternatively, you can use this library in you own Java code. See ScriptManager and XUL scripts integration for more information.

Tutorials

Main Article: Tutorials

You can start by the Hello world tutorial to know about how to write XUL scripts.

Structure of a XUL file


A XUL file is an XML file containing:
  • The declaration of the UI using XUL controls
  • The declaration of the scripts used to interact with the controls
See also the XUL controls overview for an overview of the controls you can use in your XUL scripts.

Example

Suppose the following XUL script:
      <?xml version="1.0"?>
      <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
      <window id="Hello" title="Hello" orient="horizontal" width="250" height="100" screenX="500" screenY="500"      
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
         <script>
      function clicked(){
        alert('Hello World!');
      }
         </script>    
         <button label="Push Me!" oncommand="clicked()" />
      </window>     

It will present the following window:


helloworld
Clicking on the button will show an alert popup.

FAQ

See FAQ. See also the Troubleshooting article for the errors you can encounteer when using this library.

Categories: general

Developers

Join this project:

To join this project, please contact the project administrators of this project, as shown on the project summary page.

Get the source code:

Source code for this project is available as downloads or through the git repository used by the project, as accessible from the project develop page.

Copyright 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence