[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Choosing appropriate GUI software

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
jimdgar
Asked:
jimdgar
2 Solutions
 
JavatmCommented:
> 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
 
JavatmCommented:
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
 
tomboshellCommented:
>>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
 
girionisCommented:
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
 
oraelbisCommented:
You can try new RCP platform for fast build  GUI applications
see http://www.eclipse.org/articles/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now