Results 1 to 2 of 2
Thread: Displaying println output on GUI
- 08-09-2010, 05:57 AM #1
Member
- Join Date
- Aug 2010
- Posts
- 1
- Rep Power
- 0
Displaying println output on GUI
Hello all,
I am a Java newbie. I have been writing some mini programs for personal use, although they are all command line / console apps. I have one completed program which I really want to add in GUI.
The problem is, I have used many System.out.println / System.err.println throughout the program. If I am adding in GUI elements, say a text box, how can I catch all output to console and stuff them into this text box? The last thing I want to do is go through each println and change it to a GUI-relevant line. :(
Please bare in mind I am a newbie, I would appreciate if someone can break it down and explain it down to newbie level. Some sample code would be nice. :D
Thank you!
P.S. There is another slightly off-topic question. It would be great if someone can give me some hints on that too. What's the quickest and simplest way to add in Swing into a command-line program and transform it to a GUI? I am in the process of doing so, but I think I am not going very far. I am taking too long and experiencing many problems here and there. I guess I have started off in the wrong direction.
- 08-09-2010, 01:34 PM #2
Look at the System setOut method. It will allow you to change System.out to another class. You could create you own class and have it put what was output by println() into a GUI component.
Replace console input with a text component to receive user input.way to add in Swing into a command-line program and transform it to a GUI
Similar Threads
-
Println VS system.out.println
By ccie007 in forum New To JavaReplies: 2Last Post: 05-20-2010, 08:52 AM -
displaying a formatted output on a jTextField
By techbossmb in forum AWT / SwingReplies: 1Last Post: 09-24-2009, 04:56 PM -
Java, output string, getting correct output? HELP!
By computerboyo in forum New To JavaReplies: 2Last Post: 02-25-2009, 11:44 PM -
difference between system.out.println() & out.println()
By wickedrahul9 in forum Advanced JavaReplies: 5Last Post: 10-18-2008, 11:06 PM -
No output displaying
By Rgfirefly24 in forum New To JavaReplies: 6Last Post: 04-27-2008, 08:37 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks