Is there a way to set the number of spaces shown for a tab? (tab as in a tab character)
I've made an editor using a StyledEditorKit and StyledDocument, but tabs give more spaces than I would prefer.
Is there a way to set the number of spaces shown for a tab? (tab as in a tab character)
I've made an editor using a StyledEditorKit and StyledDocument, but tabs give more spaces than I would prefer.
Hmm, I'm not sure how to do that.
Although, when I was writing a password program, I needed to output '*' instead of letters when the user was inputing their password.
So I guess you could do something similiar for the tab key.
Such as:
if char = '\t' //tab character?
then print " " //set defaults spaces here
end if
Although that's incredibly hackish, there may be a better solution?
Actually I'm not sure if the above will work.:lol:
I found this though:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/TabExpander.html
hmm?
I've taken a look at it, though I don't see a way of implementing it with a styled document
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.