Results 1 to 6 of 6
- 03-30-2009, 03:40 AM #1
You may wish to describe your problem in greater detail as the answer will depend upon the requirements. Is this a Swing app with output in a JTextField? A console app?
If the latter, then you might want to look at System.out.printf(...) method or String.format(...). They both do the same thing. You'll have to read the tutorial and API several times to "get" this (I know that I had to on the first go-around), but it's eventually worthwhile reading.
- 03-30-2009, 04:03 AM #3
Thanks for your prompt answer.
I just realized how vague my question was! Sorry about that.
I am printing(outputing) from a string linkedList both in a console and in a text file.
I need to output each String(word), with different lengths, along with a corresponding #
so my output now looks like:
but I want it to be aligned:
could I use tab (\t) somehow or do I need to use a method?
tell me which tutorials I need to read for this and I'd be willing to do that , thanks :)
- 03-30-2009, 04:27 AM #5
I have looked at both links but they talk about formatting numbers.
I didn't see an example of what I want there :(
I need to format the output sting by adding a tab or 2 after each string or something like that!
- By computerboyo in forum New To JavaReplies: 2Last Post: 02-26-2009, 12:44 AM
- By Laura Warren in forum New To JavaReplies: 2Last Post: 12-18-2008, 10:01 PM
- By Java Tip in forum Java TipReplies: 0Last Post: 03-12-2008, 12:24 PM
- By bradder in forum AWT / SwingReplies: 1Last Post: 11-29-2007, 08:08 PM
- By fred in forum New To JavaReplies: 1Last Post: 07-24-2007, 03:02 AM