Problem with strings
Hi.
I have three Strings on a program, and I want them to display in this way:
This is a test
Where "this" = String1, "is a"=String 2, "test" = String 3
Now, they are displaying like this:
This
is a
Test
I am using JOptionPane to make this.
Is there any way to accomplish this?
Regards.
[353 byte] By [
karma1234a] at [2007-11-26 22:51:05]

public static void main(String[] args) {
int i = JOptionPane.showConfirmDialog(null, "This is a test \n\nWhere \"this\" = String1, \"is a\"=String 2, \"test\" = String 3");
}
Hi, thanks for your reply.
Maybe I was not clear enough.
I have three Strings:
String1 = "This";
String2 = "is a";
String3 = "test";
I want to create a new String using the three Strings, this String is String4:
String4 = String1+String2+String3;
When I try to print String4, String4 looks like this:
This
is a
test
And I want String4 looks like this
This is a test
I hope that now the problem is clear enough.
Regards
This works fine here:
String string1 = "This";
String string2 = "is a";
String string3 = "test";
String string4 = string1 + " " + string2 + " " + string3;
JOptionPane.showConfirmDialog(this, string4);
You might have to modify "this".