Solved

tabs in String in dlg box

Posted on 2008-10-23
2
806 Views
Last Modified: 2012-05-05
I have a string defined like so
String myString = "\t\thello\nsomething else";

When displayed as the text in a dlg box (specifically, JOptionPane.showOptionDialog()), the \n shows up but the tabs are ignored.

What gives?
0
Comment
Question by:allelopath
  • 2
2 Comments
 
LVL 24

Accepted Solution

by:
sciuriware earned 500 total points
ID: 22789907
If you want to create columns in a text on a dialog,
do so using HTML and a table:

<HTML><CENTER><TABLE><TR><TD WIDTH=400>a text</TD>.....................

and so on.
Of course you decide about constants or %% to set the tabbing.

;JOOP!
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 22890718
:))
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 50
splitOdd10 challenge 5 74
create a gui in perl 3 69
Unexpected HttpURLConnection connection behavior 2 84
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now