Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TabStops

 
Steve Sinai
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - Does anyone know if there's a way to set TabStop.ALIGN_DECIMAL on a JTextPane as a default, i.e., without creating a TabSet containing lots of TabStops? I have a JTextPane with lots of numbers I'd like to align using tabs.

Thanks,
Steve Sinai
 
Brian Cole
Author
Ranch Hand
Posts: 903
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The short answer is no. Nothing is impossible and you could muck around with the Views and ViewFactories and such, but that would be much more work than just using TabStop and TabSet. Why are you reluctant to use those?
 
Steve Sinai
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I actually do use TabStops and TabSets now, but I was hoping there was an easy way to set the default behavior to align tabs along a decimal point in a number, rather than creating a bunch of TabStops and a TabSet. My pages are pretty dynamic, and it's hard to know how many TabStops will be needed on a page. Right now I'm just creating an array of 100 TabStops, but it's inevitable that someone's going to come up with a document that needs more than 100.
 
Brian Cole
Author
Ranch Hand
Posts: 903
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been thinking about this off and on, and I've decided it's actually not all that difficult to customize a View to do this.



Alas, it is cumbersome to actually use DecimalParagraphView in a JTextPane. I'll post some sample code in a subsequent post.
 
Brian Cole
Author
Ranch Hand
Posts: 903
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Cole:
Alas, it is cumbersome to actually use DecimalParagraphView in a JTextPane. I'll post some sample code in a subsequent post.



[ January 04, 2007: Message edited by: Brian Cole ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic