ABOUT US

|

SUPPORT

|

BLOG

 PRICING  | DOWNLOADS

 

User    Pass    

 

 

 

 

 

 

 

 

 

 

Features

 

Key Benefits

 

Screenshots

 

Standards Supported

 

Pricing

 

Download Now

 

API Documentation

 

Developers Guide

 

Code Examples

 

Updated Builds

 

Technical Articles

 

 

 

 

 

Jump to:

General WebRenderer Functions

  WebRenderer example code base.

 

Advanced WebRenderer functions

 

Application test examples

 

Deploying WebRenderer

WebRenderer DOM

  

  

 

WebRenderer Status bar

 

 

 

WebRenderer Status Bar functionality

WebRenderer has some convenience methods to allow the construction of a Swing status bar. Using the JProgressBar and JLabels it is easy to create a browser status bar based upon the WebRenderer Browser and Network events.

Using Events to bring your Status Bar to life

WebRenderer has some useful Network Events (com.webrenderer.events) to bring status bars and load progress bars to life.

IBrowserCanvas browser = BrowserFactory.spawnMozilla();

browser.addNetworkListener(new NetworkAdapter() {
   public void onProgressChange(NetworkEvent e) {
       //For getting text of the load progress
       System.out.println("Status Text: "+e.getStatusText());

       //Number of bytes downloaded
       System.out.println("Bytes downloaded: "+e.getCurrentProgress());
  }
});

Within the NetworkEvent class progress bar sizing and increment can be calculated by the following:

public void onProgressChange(NetworkEvent e) {
    //Total number of bytes to download for the page
    int maxNumberOfBytes = e.getMaximumProgress();

   //Status bar progress maximum size
   int maxsize = e.getMaximum();
}

Within the BrowserEvent class events such as onBeforeNavigate and onLinkChange are particularly useful for status bars.

browser.addBrowserListener(new BrowserAdapter() {
   public void onBeforeNavigate(BrowserEvent e) {
      System.out.println("Navigating to: " + e.getURL());
   }
   public void onLinkChange(BrowserEvent e) {
      System.out.println("Link: " + e.getLink()):
   }
});

 

  top

 

Millions of deployments and counting.. Users of JadeLiquid's tools can be found in every corner of the Earth

 

   News

 

 > Enabling Flash in WebRenderer - Article
 > Browser Zoom Effect using WebRenderer - Article
 > Applet deployment techniques - Article
 > WebRenderer core features on display! - Article
 
 
   Additional News  
 
 > Enabling HTML 5 WebSockets in WebRenderer - Blog
 > 64bit WebRenderer deployment with Web Start - Blog
 > Deploying WebRenderer Server Edition in Tomcat - Blog
 > WebRenderer 6 adds performance text search - Blog
 

 

 Java and the Java Logo are trademarks or registered trademarks of Oracle Corporation in the United States and other countries 

Privacy Policy  |   Disclaimer