how to set tab size

Reply

Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

how to set tab size

 
0
  #1
Apr 23rd, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: how to set tab size

 
0
  #2
Apr 23rd, 2006
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:

  1. if char = '\t' //tab character?
  2. then print " " //set defaults spaces here
  3. end if

Although that's incredibly hackish, there may be a better solution?

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: how to set tab size

 
0
  #3
Apr 23rd, 2006
Actually I'm not sure if the above will work.:lol:

I found this though:

http://java.sun.com/j2se/1.4.2/docs/...bExpander.html

hmm?

http://img476.imageshack.us/img476/5171/cut20ln.png
Piworld
[Tis simple as Pie]
Reply With Quote Quick reply to this message  
Join Date: Mar 2004
Posts: 763
Reputation: Phaelax is on a distinguished road 
Solved Threads: 38
Phaelax Phaelax is offline Offline
Master Poster

Re: how to set tab size

 
0
  #4
Apr 23rd, 2006
I've taken a look at it, though I don't see a way of implementing it with a styled document
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC