If you are running the C program within the Java app, you start the C app with
the class Runtime. This creates a Proces, and you have acces to the C app's
stdin / out as ioStreams. Capture this and send to your text component,
whatever...
Mike
David Chen wrote:
> Hi all,
>
> I have a general Java question.
>
> I was asked to make a Java GUI interface for a pre-developed project which
> was written in C. The C programs provided a set of APIs. I constructed the
> GUI using swing and made the jni program. It's functionlly working.
>
> In the pre-developed project there are a lot of printf functions. Now I
> have to show the outputs of printf in a swing text fileld. The question is
> how can I do this without touching the pre-written C programs?
>
> My first reaction is to use System.setOut(). It redirected all the
> System.out in Java but not a single printf in C.
>
> Can any one help me?
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]