Solved

Choosing appropriate GUI software

Posted on 2004-08-09
5
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 15

Assisted Solution

by:Javatm
Javatm earned 150 total points
ID: 11759580
> 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
ID: 11759598
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
ID: 11759972
>>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
ID: 11759992
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
ID: 11762951
You can try new RCP platform for fast build  GUI applications
see http://www.eclipse.org/articles/
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
use lov values 2 72
jboss 7.1 start up error 1 64
ejb entity bean example issue 2 27
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 27
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 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