• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with modelToView()  RSS feed

 
Philip Yang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all,
I am having problem with modelToView(component,pos) while using JTextPane.
The return value is always a Rectangle with width 0 and height 17 no matter styles and the pos.
Sample code:
JTextPane test = new JTextPane();
test.setText("aaaa\nbbbbbb\ncccccc");
java.awt.Rectangle rec = test.getUI().modelToView(test,test.getDocument().getLength()-1);
Any suggestions?
Thanks
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!