Results 1 to 8 of 8
Thread: Bottom-Up JTextPane
- 10-13-2010, 06:27 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 13
- Rep Power
- 0
- 10-13-2010, 10:31 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
Every text component has a model (Document). The interface declare a method insertString(int offset, String str, AttributeSet a).
So you could get the textpanes document with pane.getDocument() and call insertString with an offset of 0 :DLast edited by eRaaaa; 10-14-2010 at 12:50 AM.
- 10-14-2010, 04:39 AM #3
I think you misunderstood the requirement. Possibly you don't use Skype, and the OP didn't post a very good description.
What the OP wants is a text area where the text is bottom aligned, with all the extra empty space appearing above the text instead of the usual text at the top of the area and blank space below.
db
- 10-14-2010, 03:29 PM #4
Member
- Join Date
- Jan 2010
- Posts
- 13
- Rep Power
- 0
That's exactly what I'm trying to do! Any ideas?
-
eRaaaa's idea should still be able to work, but you'd have to use a different offset, probably one that matches the current size of the Document.
OP, what have you tried?
- 10-14-2010, 03:53 PM #6
Argh, I posted this exact question a couple months ago in the Sun forums, and eventually did find a great solution. Unfortunately, I can't find it now. Does anybody know how to search by thread starter in the old forums?
- 10-15-2010, 03:10 AM #7
Google-fu ;)
Swing - Vertical Alignment of Text in JEditorPane
Third hit on
kevinaworkman jeditorpane site:forums.sun.com - Google Search
db
edit Add
http://forums.sun.com/thread.jspa?threadID=5420279
- 10-15-2010, 06:33 AM #8
And since those Sun forum links won't be available forever (:sniff: )
OTN Discussion Forums : Vertical Alignment of Text in ...
OTN Discussion Forums : Vertical Scrolling and Horizontal ...
dbLast edited by DarrylBurke; 10-15-2010 at 06:38 AM.
Similar Threads
-
SCJP Voucher @ Rock Bottom Price
By nphariharan in forum Java CertificationReplies: 0Last Post: 07-01-2010, 04:00 PM -
My JOptionPane Scrolls to Bottom!
By AJArmstron@aol.com in forum New To JavaReplies: 6Last Post: 04-17-2010, 12:58 AM -
Bottom-Up or Top-Down
By 3xpr1ment in forum New To JavaReplies: 5Last Post: 03-31-2010, 09:18 AM -
How to make an icon in bottom-right of screen
By hunterbdb in forum AWT / SwingReplies: 1Last Post: 08-13-2009, 08:28 AM -
JButtons in a straight line on the BOTTOM
By paul in forum AWT / SwingReplies: 0Last Post: 07-16-2007, 04:47 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks