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

 

 

 

 

 

  

  

 

Element from point

 

 

 

Retrieving DOM elements from a mouse click/point on screen

The WebRenderer DOM method elementFromPoint is one of the DOMs most useful and powerful methods. getTargetElement retrieves the HTML DOM element from the location of the mouse click.

//Required imports
import com.webrenderer.swing.event.MouseAdapter;
import com.webrenderer.swing.event.MouseEvent;

IBrowserCanvas browser = BrowserFactory.spawnMozilla();

//Getting the DOM Document
IDocument document = browser.getDocument();

Practical example in a Mouse Listener

browser.addMouseListener(new MouseAdapter() {
   public void onClick(MouseEvent e) {
         //Getting the IElement from the corresponding click
         IElement element = e.getTargetElement();
         System.out.println("Element:" + element.getTagName());
    }
});

  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