Saturday, 17 August 2013

how to convert char to string

how to convert char to string

I have a word as string that want to take a character of it and assign it
as the button name. As you know button only accepts String.
String possibleLetters = "asdaAsadWERWasdas";
for (int i = 0; i <= possibleLetters.length(); i++)
{
String bottonName = possibleLetters.charAt(i);
JButton letterBottons = new JButton(bottonName);
}

No comments:

Post a Comment