embedded browser in processing - to be controlled through processing
in
Programming Questions
•
3 years ago
Hello everyone, first post here :) I have some programming knowledge but I am still quite unexperienced relatively to bigger projects. I am now designing a human-computer interface for disabled people based on eye movement through electrooculogrpahy (
http://en.wikipedia.org/wiki/Electrooculography) as my research thesis.
Decided to go with Processing to design the GUI. I am doing a whole interface based on looking up, down, left, right, diagonals (up-right, down-right, etc.) and blinking. So far I have done a text input interface and a system to select editable preset sentences. I'd like to go further and at least include a web browser and a mouse controller. I've seen both of these being done.
I'm now trying to implement the web browser. I have come to find a solution based on Native Swing and another based on JDIC. If I could properly implement the Native Swing option it would be awesome since it would allow to implement a media player, etc.
Anyone had any experience with using
Native Swing in Processing? I haven't been able to implement even the simplest functions:
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import chrriis.dj.nativeswing.swtimpl.*;
- void setup() {
- size(800,600);
- NativeInterface.open();
- NativeSwing.initialize();
- JWebBrowser webbrowser = new JWebBrowser();
- webbrowser.navigate("http://www.test.com");
- }
When I try to call the "webbrowser.navigate()" I get "IllegalStateException: This call must happen in the AWT Event Dispatch Thread". I realize that processing has problems with swing. Do I have to go full-blown java to do this? Like
http://processing.org/hacks/hacks:swingsliders ?
As for the
JDIC I found watz's code (
http://workshop.evolutionzone.com/2008/09/06/multiple-jdic-browsers-in-processing-sketch/) for embedding 4 windows.
-To begin with I allways get a "Cannot find a class or type name "BrowserEngineManager"" and I've tried like three different releases of JDIC...
-If I comment lines 43 and 44 the applet runs but I cannot choose which browser to use and the presentation does not display the 2X2 grid it's suposed. I get a 3X2 grid with the top-left and bottom-right cells simply in grey. And yeah, I just want browser window and maybe some room to put my GUI in.
Any tips?
Edit: yeah, I'm running 1.2.1 on Win7 and the latest releases of JDIC, SWT and Native Swing
1