I need to add the text that is typed into a JTextField to a string array String[] by using a JButton. For example, if I type into a JTextField, I would click a JButton which would add that text into a String[]. I can't use an ArrayList for this, I must use a String stringa[].
Here's what I have so far:
if(g.getSource() == jbutton) {
stringa.add(jtextfield.getText());
}
It's very important to note I can't use an ArrayList but I don't know how to add to a String[]this way. Thank you for any help.