Help inserting contents of a string array into a JPanel
Posted on 2006-03-21
Working on a project for school and have it a road block, being spring break all the normal avenues for help and currently cutoff. SI's probably in Tijuana or something.
Anyway, project is a simple game. At the begining I ask for player information and prompt for more players.
I have setup in my GUI using border layout and intend to place the player info in the north.
I'm thinking I need to use a JTextarea for this maybe.
heres a snipet of the code I am working with so far.
String playerName = JOptionPane.showInputDialog("Please Enter the Players Name.");
String age = JOptionPane.showInputDialog("Enter the Players Age.");
int playerAge = Integer.parseInt(age);
int playerScore = 0;
// Enter Player into Player Array
playerArray [lastPlayer] = new Players ( playerName, playerAge, playerScore );
prompt = JOptionPane.showConfirmDialog(null,"Add another Player?");
} while( prompt == JOptionPane.YES_OPTION );
I am at a loss for how to get it placed into the north field.