Hi guys ^^
I was wondering if anyone could help me with this problem. I'm pretty sure
Its not complicated, I just don't know how to do it. Basicly I have a loop
which gets information from a database and adds it to a string in a loop
for each records of the database. I also do a carriage return so that I have
1 record per line.
This I do all correctly, I have no problems with this. The only problem comes
when I want to put up my string in a JOptionPane or a InputBox.
The values aren't aligned.
I get values like:
1 Java 87 "One Awesome class"
2 VisualBasic 67 "little boring"
3 COBOL 100 "lol"
Basicly id like it better if I could put it up such as:
1 Java--------87----"One Awesome class"
2 VisualBasic--67----"little boring"
3 COBOL------100---"lol"
(Replace - by spaces)
If anyone could help me with this, it would be greatly appreciated..
I'm sure theres a method probably associated to a string to do it,
I just don't know which one :(
anyways thanks guys :)
String alignement question
Started by SinXJon, Feb 14 2008 03:47 PM
3 replies to this topic
#1
Posted 14 February 2008 - 03:47 PM
|
|
|
#2
Posted 14 February 2008 - 09:34 PM
I'm not sure there is a particular function that does what you are looking for, but you could create a function that add's `n` amount of spaces to the string...
#3
Posted 15 February 2008 - 12:48 PM
Boy, was that a confusing post...
How about some code to help us out?
How about some code to help us out?
~Aristotle said:
It is the mark of an educated mind to entertain a tought without accepting it
#4
Posted 15 February 2008 - 01:42 PM
use \\t to tab and allign the data in your string.


Sign In
Create Account

Back to top









