Solved

Choosing appropriate GUI software

Posted on 2004-08-09
5
185 Views
Last Modified: 2010-03-31
I have an application which is used strictly by engineers within my company.  The app is written in C, is fairly complex (judged by # of lines of code, not code complexity), and currently runs only on SunOS in a command line mode.  The goal is to add a GUI interface and also support the app in Linux (in addition to SunOS).

With a minimal amount of research I chose Java using NetBeans IDE, thinking this would be the best platform independent tool.  The Java implementation went fairly well and I like the IDE, but now I'm having second thoughts about Java.  There's no way I'm rewriting the C code, so any GUI code needs to smoothly interface with the C code.  The biggest problem is that I simply cannot find a clean way of using Java to launch the C app and pass data back and forth.  Runtime.exec is basically a dumb interface and despite one week+ of work I could not get JNI to work.  I haven't found any other method.  The 2nd problem is that this is not a web app; it must run locally on each workstation.  I'm finding that I have to write the Java code to the lowest common demoninator (old rev Java) to get it to work for all users, or force some users to upgrade their Java installs.

So now I'm wondering if I should have just used Motif to begin with, or is there something about Java I've missed.  Motif seemed much more difficult to work with, but it has the huge advantage of being integrated with the C code and compiled together (I use gcc).

I'm looking for compelling arguments to these questions:
1.  Which is the best GUI for my needs?  Priorities are 1) integration with existing C code, 2) ease of development, 3) tools cost.
2.  Will it work as well in Linux?
3.  (there is a remote chance of adding Windows support, but this is not a factor).

0
Comment
Question by:jimdgar
5 Comments
 
LVL 15

Assisted Solution

by:Javatm
Javatm earned 150 total points
Comment Utility
> There's no way I'm rewriting the C code, so any GUI code needs to smoothly interface with the C code.  
> The biggest problem is that I simply cannot find a clean way of using Java to launch the C app and pass data back and forth.  
> Runtime.exec is basically a dumb interface and despite one week+ of work I could not get JNI to work.  

Actually JNI is the only interface that Java has to offer over C, and if you really want your project to get over with then
I would suggest to learn JNI from scratch. If you really dont wanna deal w/ the whole convertion then just have
your C codes be converted C++ codes.

> 1.  Which is the best GUI for my needs?  Priorities are 1) integration with existing C code, 2) ease of development, 3) tools cost.

Well Java can handle that but if your having a hard time on it as what I suggested rebuilt it in C++.

> 2.  Will it work as well in Linux?

Yes it will . . .

> 3.  (there is a remote chance of adding Windows support, but this is not a factor).

Yes can be translated to windows platform.

Hope that helps . . .
Javatm

0
 
LVL 15

Expert Comment

by:Javatm
Comment Utility
You can download the free C++ compiler
http://www.borland.com/products/downloads/download_cbuilder.html#

Or you may choose the enterprise or personal edition  :
http://www.borland.com/products/downloads/download_cbuilderx.html

If you want a real totally free the go w/ Java and JNI

Hope that helps . . .
Javatm
0
 
LVL 7

Expert Comment

by:tomboshell
Comment Utility
>>1.  Which is the best GUI for my needs?  Priorities are 1) integration with existing C code, 2) ease of development, 3) tools cost.
There are many, Swing and SWT are some of the best.  It really seams that your stumbling block would be the communication between the new gui and the older tool.  You mentioned JNI, which I find is an entire world of its own and not to be taken lightly.  I just had an idea...would it be too complicated to provide a small server front-end for the older tool which would handle the requests and send something like xml to the java program.  That way you would also be providing for possible future options like a web-front end and so on.  Connect through sockets or https would then become very simple.  
Tool costs vary.  All the IDEs are comparable in functionality (which is the best is an often questioned topic here) and costs range from free to thousands.

>>2.  Will it work as well in Linux?
If (notice the 'if') programmed properly in Java it will run on any platform.  One major consideration is when working with files.  Often people who develop on one platform like to automatically use the file charactersists specific to that platform, then it will not run on another.  But if the programmer is careful and takes many platforms into consideration this will not be a problem.  

>>3.  (there is a remote chance of adding Windows support, but this is not a factor).
See answer 2.  But this is also why I would suggest implementing a C server for the older program.  I would not know if the older tool runs on all platforms, and if not, then this is a good way to get around such a problem.  
0
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
Comment Utility
I am not sure if you have seen that but it may give you some clues: http://www.javaworld.com/javaworld/jw-05-2001/jw-0511-legacy.html
0
 
LVL 3

Expert Comment

by:oraelbis
Comment Utility
You can try new RCP platform for fast build  GUI applications
see http://www.eclipse.org/articles/
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now