Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane.

 
Bob Green
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's my code:

String[] possibleValues = { "0", "5", "10", "15",
"20", "25", "30", "35", "40", "45", "50", "55", "60" };

Object selectedValue =
JOptionPane.showInputDialog(
null,
"Please select refreshing interval in mins:",
"Refresh",
JOptionPane.INFORMATION_MESSAGE,
null,
possibleValues,
possibleValues[0]);

When possibleValues is displayed in the dialog, each of its elements contain trailing spaces, how do I get rid of them.

Thanks in advance.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The elements don't have trailing spaces. The combo box is getting extended to the width of the label above it (which contains the phrase: "Please select refreshing interval in mins:").
 
Bob Green
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,
Thanks for the reply. I did make the phrase shorter and still it does seem
to change the length of the elements in the drop down.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!