Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT-Browser: Call Java-Method from onclick-Event?
SWT-Browser: Call Java-Method from onclick-Event? [message #462219] Sat, 08 October 2005 11:59 Go to next message
Eclipse UserFriend
Originally posted by: hapet.gmx.at

Hi,

Is it possible to call a method of a java-class from within the
onclick-Event inside the HTML of the SWT-Browser component?

This way it would be possible to build GUI's with the Browser-Component....
In my case, I want a Java-Method to be called when the user clicks a
certain table-row.

Hannes
Re: SWT-Browser: Call Java-Method from onclick-Event? [message #462238 is a reply to message #462219] Sun, 09 October 2005 03:11 Go to previous message
Jeff Myers is currently offline Jeff MyersFriend
Messages: 396
Registered: July 2009
Senior Member
Hannes,

This can be achieved by communicating between javascript and java
through the status text on the browser. You can have the onclick
javascript event set the window.status field to a text value that
contains the information you need to send to the java side. On the java
side you add a StatusTextListener to the browser to listen for changes
to the status text, and respond accordingly.

See this snippet for ideas on how to accomplish this:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet160.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup

Hope this helps,
- Jeff

Hannes wrote:
> Hi,
>
> Is it possible to call a method of a java-class from within the
> onclick-Event inside the HTML of the SWT-Browser component?
>
> This way it would be possible to build GUI's with the Browser-Component....
> In my case, I want a Java-Method to be called when the user clicks a
> certain table-row.
>
> Hannes
Previous Topic:Help!!!Who knows how to set the table's column editable in SWT !!!
Next Topic:How to set just one cell in table 's column to combo in SWT
Goto Forum:
  


Current Time: Sat Sep 26 08:48:54 GMT 2020

Powered by FUDForum. Page generated in 0.01565 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top