944,030 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 8899
  • Java RSS
Apr 23rd, 2006
0

how to set tab size

Expand Post »
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.
Similar Threads
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Apr 23rd, 2006
0

Re: how to set tab size

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:

Java Syntax (Toggle Plain Text)
  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]
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Apr 23rd, 2006
0

Re: how to set tab size

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]
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Apr 23rd, 2006
0

Re: how to set tab size

I've taken a look at it, though I don't see a way of implementing it with a styled document
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: FTP Client / Server using RMI
Next Thread in Java Forum Timeline: How to get the different playback ports of sound card





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC