Java Swing Class Questions (Simple)? - simple swing set blueprints
1) How can a character in a text box instead of a string?
userGuess public char ()
(
userGuess guessTextField.getText = char (). trim ();
asciiValue int = ((int) (userGuess));
if ((asciiValue> = 97) & & (asciiValue \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; = 122))
(
userGuess = ((char) (asciiValue - 32));
)
userGuess return;
)
2) How do I configuring a JLabel print an ArrayList?
public void update Board (char userGuess, String password, ArrayList u0026lt Board \\ \\ \\ \\ \\ \\ \\ \\,> characters)
(
for (int i = 0 to analyze, analyze u0026lt \\ \\ \\ \\ \\ \\ \\ \\; = (word.length () - 1) + Analysis +)
(
currentChar char = word.charAt (analyze);
if (currentChar == userGuess)
(
analyze board.remove ();
board.add analyze (, userGuess);
)
)
boardLabel.setText (on board);
)
No comments:
Post a Comment