• Post Reply Bookmark Topic Watch Topic
  • New Topic

using tab spacing in JOptionPane.showInputDialog

 
Senaca Boyd
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
\t does not appear to be working with showInputDialog. How can I create tab spacing in JOptionPane.showInputDialog?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can do this, but you may have to add some font tags
JOptionPane.showInputDialog(null,"<html><pre>word\tword</pre></html>");

but it might be easier to add a pad of the number of spaces you want
String pad = " ";//8 spaces
JOptionPane.showInputDialog(null,"word"+pad+"word");
 
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!