Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 23rd, 2006, 06:11 AM
itel itel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 33 itel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 7 m 9 sec
Reputation Power: 3
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.

Reply With Quote
  #2  
Old November 23rd, 2006, 10:10 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old November 28th, 2006, 04:11 PM
fizker fizker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: denmark
Posts: 42 fizker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 18 sec
Reputation Power: 5
Send a message via MSN to fizker
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

Reply With Quote
  #4  
Old December 1st, 2006, 07:48 AM
itel itel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2006
Posts: 33 itel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 7 m 9 sec
Reputation Power: 3
Thanks

Reply With Quote
  #5  
Old December 7th, 2006, 07:03 AM
Ari Dahi Ari Dahi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 Ari Dahi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 35 sec
Reputation Power: 0
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:
Originally Posted by itel
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Question for all java programers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT