SWING GUI CONSOLE WINDOW DISPLAY
Hi, i am creating a swing gui and i need to be able to display the return of a function within the gui
when i call the function the result e.g. System.out.println etc is displayed in the console window, i need what is displayed in the console to be visible in the GUI.
what component can i use to do this,
I tried using a Jlabel and setting the labels text to the system.out.println statements but it dosnt work.
Thanks
Re: SWING GUI CONSOLE WINDOW DISPLAY
Quote:
Originally Posted by
Khadafi
Hi, i am creating a swing gui and i need to be able to display the return of a function within the gui
when i call the function the result e.g. System.out.println etc is displayed in the console window, i need what is displayed in the console to be visible in the GUI.
what component can i use to do this,
I tried using a Jlabel and setting the labels text to the system.out.println statements but it dosnt work.
Thanks
You need to go through these tutorials Lesson: Getting Started with Swing (The Java™ Tutorials > Creating a GUI With JFC/Swing)
Re: SWING GUI CONSOLE WINDOW DISPLAY
Thanks thats what I have been using whilst making the GUI.
but i am not sure of how to display the console within the GUI.
thanks
Re: SWING GUI CONSOLE WINDOW DISPLAY
Quote:
Originally Posted by
Khadafi
Thanks thats what I have been using whilst making the GUI.
but i am not sure of how to display the console within the GUI.
thanks
If you thoroughly read the given link tutorial you will for sure get what you desire. Well, did you try text area?
Re: SWING GUI CONSOLE WINDOW DISPLAY
Quote:
how to display the console within the GUI.
Are you referring to the Strings printed by calls to System.out.print()?
You can change where the output goes from that print method call to go to your code where you can put it into a text area.
See the System class for the method(s) to use.
Re: SWING GUI CONSOLE WINDOW DISPLAY
Yes thing printed out via System.out.print().
Ill try that now.
Thanks