This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane and Unicode characters  RSS feed

 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get tabs to display in a JOptionPane. Does anyone know of a workaround to get the JOptionPane to recognize special characters? (I've also tried using Unicode chars without any luck.)
The pane displays a tab as square box.
Any help would be appreciated!!
Glen
Here's a sample:
import javax.swing.JOptionPane;

public class TestChar
{
static String temp2 = new String("test" + '\t' + "test");

public static void main(String[] args)
{
System.out.println(temp2);
JOptionPane.showMessageDialog(null,temp2,"Title",JOptionPane.INFORMATION_MESSAGE);
}
}

[This message has been edited by Glen Tanner (edited February 03, 2000).]
[This message has been edited by Glen Tanner (edited February 03, 2000).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A workaround would be to substitute tabs in the input text for spaces yourself. For example:

Is that the kind of thing you were looking for?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!