Reputation: 1
Creating Swing console with JTextArea
and using append text or string (System.out.println
). What is more effective?
I am trying to do console in Swing by using text area. To take string and output to text area with some features like auto completion. What technique would be more effective using append text or strim(System.out.println)? The text area is intended to hold huge amount of entries.
Upvotes: 0
Views: 846
Reputation: 14697
You can look at Message Console . I hope this will satisfy your need.
If you wants to use the JTextArea for logging purpose I would suggest to use some logging framework and render the output to the JTextArea or JTextPane. JTextPane will give you flexibility to add the content in different color as well. My favorite is Log4j. You would have choice to customize them.
You can also choose according to your need. Here is the list of comprehensive logging framework.
You can also look this SO question
Upvotes: 1