I am trying to do a project for my class. I am supposed to build 3 columns of data. here is the code for a GUI class:
public void displayArray(String[] wordArray) {
Container myContentPane = project1JFrame.getContentPane();
TextArea arrayArea = new TextArea();
for (int i = 0; i < wordArray.length; i++) {
if (wordArray[i] != null) {
arrayArea.append(wordArray[i] + "\n"); // add the words of the array into the TextArea
}
} //for
myContentPane.add(arrayArea, BorderLayout.WEST);
project1JFrame.setVisible(true);
} //displayArray
public void displaySortedArray(String[] wordArray) {
Container myContentPane = project1JFrame.getContentPane();
TextArea arrayArea = new TextArea();
for (int i = 0; i < wordArray.length; i++) {
if (wordArray[i] != null) {
arrayArea.append(wordArray[i] + "\n"); // add the words of the array into the TextArea
}
} //for
myContentPane.add(arrayArea, BorderLayout.CENTER);
project1JFrame.setVisible(true);
} //displaySortedArray
public void displaySortedList(WordList myList) {
Container myContentPane = project1JFrame.getContentPane();
TextArea listArea = new TextArea();
WordListIterator myIt;
listArea.setText("");
myIt = myList.reset();
while (myIt.hasNext()) {
myList.append(myIt.next() + "\n");
}
myContentPane.add(listArea, BorderLayout.EAST);
project1JFrame.setVisible(true);
}
When i try to run this code along with my main program, i only get 2 columns. I want 3 columns. I am guessing it has something to do with border layout but i cant seem to do it. Help please!