wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Logging Tab Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Logging Tab" Watch "Logging Tab" New topic
Author

Logging Tab

Patrick Brahami
Ranch Hand

Joined: Oct 12, 2008
Posts: 32
Alright I have finally finished my application business logic and GUI(Swing if it matters).
(a lot thanks to you Java Ranch community!!)

I want to create a new tab that only I (the program) will be able to write to, and it will be just a white text field with messages. And I'll even let the user ability to save it as text file.

Again, I've got naive solutions in my head. But I prefer to advice before
starting so the idea is - how is it done?
Should I work with a label? a big text box?
How can I write line at a time? and is there a limit on the size of lines that can be written to a textbox?

Thanks in advance.
[ October 19, 2008: Message edited by: Patrick Brahami ]
Pavan Kumar Srinivasan
Greenhorn

Joined: Sep 17, 2008
Posts: 27
For multiple lines use a JTextArea and set editable to false for other users.
Patrick Brahami
Ranch Hand

Joined: Oct 12, 2008
Posts: 32
I see. Fits nice.
How can I append text in different color/font size?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Check out JTextPane and StyledDocument.
You can find some examples here:
http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging Tab
 
Similar Threads
How to use table in div tag
JTabbedPane: Tab Text, Tab Width and Tab Height
jtextpane align content
Dojo and Liferay integration
Call object from specific tab