• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TabStops

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 986
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic