Hi Kevin,
I started doing this - integrating calls to TurboVNC's Java VncViewer into our
own custom GUI. I could give you access to some code (shared under GPL) if you
like, but my Java project was abandoned, so there are no guarantees about the
current state of the code.
I started out by doing exactly what you are doing - calling the VncViewer
constructor, but I later found that doing so didn't give me enough flexibility,
because I wanted to be able to display the TurboVNC Java Viewer's options
dialog first from the main GUI thread, and then do the actual VNC connection
later on in my login thread.
Basically, I split up the com.turbovnc.vncviewer.CConn class's constructor, so
that it was possible to do a more minimal initialization of a CConn object to
enable the OptionsDialogCallback methods, and then run the rest of the
initialization later.
So my VNC connection thread ended up looking like this (including code
blatantly copied from the com.turbovnc.vncviewer.VncViewer class of course):
Thread turboVncThread = new Thread() {
public void run() {
turboVncConnection.opts.serverName = "localhost::" +
turboVncConnection.opts.tunnelLocalPort;
try {
turboVncConnection.initCConn(MyAppMainFrame.turboVncViewer, null);
while (!turboVncConnection.shuttingDown())
turboVncConnection.processMsg(false);
System.exit(0);
}
catch(com.turbovnc.rdr.EndOfStream e) {
System.exit(0);
}
turboVncConnection.reset();
System.gc();
}
};
MyAppMainFrame.turboVncViewer.nViewers++;
turboVncThread.start();
Cheers,
James
On 12/07/2013, at 8:21 AM, Kevin Van Workum wrote:
> I'm trying to integrate the java turbovnc viewer with another java
> application. The application is a user portal GUI. This is how I'm currently
> doing it:
>
> try {
> System.out.println("Launching the viewer");
> viewer = new VncViewer(viewer_args);
> viewer.start();
> } catch (Exception e) {
> System.out.println("viewer.start failed: " + e);
> }
>
> I had to make a slight change to the VncViewer so that my portal app wouldn't
> close when the viewer is closed. Everything seems to work fine (except for
> fullscreen on OSX). Just wondering if you had a better way to start a the
> viewer. Maybe I should do this in a separate thread?
>
> Thanks.
>
> --
> Kevin Van Workum, PhD
> Sabalcore Computing Inc.
> "Where Data Becomes Discovery"
> http://www.sabalcore.com
> 877-492-8027 ext. 11
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk_______________________________________________
> VirtualGL-Users mailing list
> VirtualGL-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtualgl-users
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
VirtualGL-Users mailing list
VirtualGL-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-users