|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question for all java programers
Hi all!
I have a program written in C and I want to do a graphic interface for this program. Is this possible to do in Java and how to use my C code or include it into a Java program? Thanks a lot for any kind of suggestion. |
|
#2
|
||||
|
||||
|
I have read articles (sorry, I can't find links to them) on how to compile a C class into a DLL and reference it in Java. The downside that I could see is you really lose Java's portability. The DLL would likely be Windows-only.
Personally, I think you would be better doing it either completely in C or completely in Java. C/C++ will have a faster GUI, but Java will have better platform support (not writing code twice). That's my two-cents... I'd love to hear from anyone who has actually attempted this though.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
the keyword you are looking for is jni (short for java native interface), and google have a lot of answers if you search it.
__________________
Benjamin Horsleben horsleben.com/benjamin Don't blame malice for what stupidity can explain |
|
#4
|
|||
|
|||
|
Thanks
|
|
#5
|
|||
|
|||
|
Yes you can use C code into Java.....
Hello,
We can use c code in Java in very easy way. Actuly as we know, C is procedure oriented Language. That means everything in C is embeded in functions, And if you want to use C code means you only need to give call to that function. For that you will require C compliled DLL and you need to declare funtions which you are going to call in Java as Extern C " I know the concept but till today i dont need to implement it, else i provide you code too" Thanks. Ari D. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > Question for all java programers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|