473,587 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display a C++ window in a java GUI

Hi,

I've got a java program and a c++ one.

The Java program`s output is a GUI, using swing and awt componants.

THe Cpp program is a 3D engine: OSG, Open Scene Graph., displaying a
3D model in the screne, with interaction : so that the user can move
on the scene, thanks to the mouse or keyboard.

Actually the Java is used as a command panel fot the 3Dengine.

I would like to know if i can have the Cpp ouput window (the 3D ouput
form the OSG cpp)
in a Java componant > frame or anything : so that I would be able to
keep all my software in only one main GUI.

I heard about python to solve my problem if JNI can't, but is it
possible to do this in Python ?
What can give me Python that Java can´t ?
Could nt be more difficult to use a third language ?

Thanks for you help !

Bart
Jul 22 '05 #1
5 5536
myself i wouldn't really think of Python for anything but parsing
strings and databases for which it was designed. always use the right
tool for the right job. as for a C++ GUI window inside Java, JNI should
be able to help you out there. if not you can give JMF a whirl, it was
designed to interface with all sorts of image rendering devices both in
and out.... should be a no brianer provided you find an appropaite JMF
example to go by....

- perry

bart59 wrote:
Hi,

I've got a java program and a c++ one.

The Java program`s output is a GUI, using swing and awt componants.

THe Cpp program is a 3D engine: OSG, Open Scene Graph., displaying a
3D model in the screne, with interaction : so that the user can move
on the scene, thanks to the mouse or keyboard.

Actually the Java is used as a command panel fot the 3Dengine.

I would like to know if i can have the Cpp ouput window (the 3D ouput
form the OSG cpp)
in a Java componant > frame or anything : so that I would be able to
keep all my software in only one main GUI.

I heard about python to solve my problem if JNI can't, but is it
possible to do this in Python ?
What can give me Python that Java can´t ?
Could nt be more difficult to use a third language ?

Thanks for you help !

Bart


Jul 22 '05 #2
bart59 wrote:
I would like to know if i can have the Cpp ouput window (the 3D ouput
form the OSG cpp)
in a Java componant > frame or anything : so that I would be able to
keep all my software in only one main GUI.


Well, if your C++ part renders the data on an own window or region of
the native operating system, then I would not do it. Little to nothing
is known about how to integrate a native window into a Java frame.
There is no public API available in Java to "merge" an entirely native
component with a Java container. So you would have to do some extensive
source code study. You need to get the complete source code from Sun,
especially the native C part, which is not packed with the Java SDK
(AFAIK available with a special license from Sun). Examining the
implementation of the native peer of java.awt.Canvas for your platform
would be a good start.

If your C++ code just provides the data, then you could use JNI to
render the data on a Java component like Canvas. An example is given in
http://java.sun.com/j2se/1.4.2/docs/...Interface.html
including some C and Java code.

Another alternative would be to consider re-writing the C++ part in
Java, and taking advantage of the existing 3D systems for Java.
Check comp.lang.java. 3d
/Thomas
Jul 22 '05 #3
* Thomas Weidenfeller <no****@ericsso n.invalid> schriebt:
bart59 wrote:
I would like to know if i can have the Cpp ouput window (the 3D ouput
form the OSG cpp)
in a Java componant > frame or anything : so that I would be able to
keep all my software in only one main GUI.


Well, if your C++ part renders the data on an own window or region of
the native operating system, then I would not do it. Little to nothing
is known about how to integrate a native window into a Java frame.
There is no public API available in Java to "merge" an entirely native
component with a Java container.


<ot>
The above is incorrect.
</ot>

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 22 '05 #4
But JAWT should be able to render such a C++ window no ?

I thought the main problem would come from the mouse interaction on
the java canvas containing the C++ renderer...

Sun give some exemples displaying an OpenGl engine in C++ in a Java
window.
Jul 22 '05 #5
There exists no such thing as a C++ window.

!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!
To iterate is human, to recurse divine.
-L. Peter Deutsch
!!!!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2340
by: Rob Jagger | last post by:
Here's what I'm trying to do: I have a series of Visio drawings that represent the toplogy of the LAN here in the office. I would like to display the drawings in a web browser so that the user can click on any of the devices or links that are shown on the diagram. The usage statistics of the link or device would then pop-up in a separate...
13
6583
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater which checks for fresh updates, then installs them, then launches the game client. We have begun our beta test, and would like to have the client open...
1
1882
by: bart59 | last post by:
Hi, I've got a java program and a c++ one. The Java program`s output is a GUI, using swing and awt componants. THe Cpp program is a 3D engine: OSG, Open Scene Graph., displaying a 3D model in the screne, with interaction : so that the user can move on the scene, thanks to the mouse or keyboard.
0
1893
by: Ferry Boender | last post by:
Hi, I'm relatively new to Xlib programming, and I ran into a little problem. I'm trying to insert keypress events into a X window. The following code works: --8<------------------------------------------------------------ #!/usr/bin/python
15
3146
by: cssExp | last post by:
hello, Rather than going on a wild explanation on what's the the problem, it'll be much quicker and easier if i let you look at it yourself, so I'll post my page source (actual contents taken out, of course). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
0
940
by: hemel | last post by:
I want to retrive login window user name(load OS) and display in internet explorer. How can I do to display this information with Java Script.
1
2980
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title>
2
3254
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML and CSS code. 1. When I clear cache and refresh my webpage, it takes 3 tries before the popup window displays - I click on the button...
12
7347
by: Lahiru778 | last post by:
I require to appear the Name which i click on the "new.php" page in the "Window_open.php" page..I use some Java Script also to accomplish this but I couldn't.. Could you pleas Help ...!!! ----------The Code in "Window_open.php" ------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
0
7915
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5712
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.