Computing.Net > Forums > Programming > C++ GUI in a java program

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++ GUI in a java program

Reply to Message Icon

Name: chase
Date: June 13, 2008 at 09:52:38 Pacific
OS: XP
CPU/Ram: pentium 4 4g
Product: hp
Comment:

As the title states, I am attempting to implement a C++ GUI into a Java application. I am using Eclipse editor for writing most of the code. The program was initially used with a Java GUI, but to make it easier for people to use I was given a C++ different GUI interface. The code is written for the GUI already. If anyone could give me a detailed answer on how to make the C++ GUI work with my Java program I would really appreciate it!



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: June 13, 2008 at 17:48:17 Pacific
Reply:

Well, off the top of my head, I can think of a few options.
1) Add command-line argument support and console output for your Java app, then have the C++ front-end run your Java app with the required arguments, then parse the output.

2) Implement something like Named Pipes. (Bonus: link provides sample Java and C code.) When up and running, this would probably be faster than #1, but it requires more "things be broke" logic, and more cleanup.

3) Rewrite the C++ front-end in Java, and incorporate it into your Java app. It's probably what I'd lobby for, if just for the unified code base and simplified maintenance costs. It could also be the most expensive up front. Or it could not. I don't know; I'm obviously not involved with your project.

MSDN has some good reference into interprocess communications, but it deals with C/C++ and not Java. You might want to read it regardless.


0

Response Number 2
Name: klint
Date: June 14, 2008 at 03:29:38 Pacific
Reply:

Can you not use JNI?


0

Response Number 3
Name: Razor2.3
Date: June 15, 2008 at 17:13:12 Pacific
Reply:

Oh, wow, JNI. I completely forgot about that. Guess that shows how much I use Java. I'm told that it's a pain, though.


0

Response Number 4
Name: klint
Date: June 16, 2008 at 01:06:38 Pacific
Reply:

Yes, I certainly wouldn't say it's easy. But it may be one of the options.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Copy folders in a batch f... PHP 5.2.5 Only 6.65 MB?



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++ GUI in a java program

java program homework help www.computing.net/answers/programming/java-program-homework-help/17649.html

clickable link in a java applet www.computing.net/answers/programming/clickable-link-in-a-java-applet/12735.html

Need help with a Java Program www.computing.net/answers/programming/need-help-with-a-java-program/12412.html