| 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: 26
|
|
|
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: 8433
|
|
Check out JTextPane and StyledDocument. You can find some examples here: http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
 |
|
|
subject: Logging Tab
|
|
|