I'm writing a custom notepad as a challenge for some youngsters. I need a text field so the user can write their data into. For some reason, when I try to go out of bounds or hit the button "Enter" the text will keep going, and will never create a new line.
Here is the code. I have tried setting bounds, but it does not work.
private JComponent textField() { JComponent text = new JPanel(); TextField field = new TextField(); text.add(field); text.setLayout(new GridLayout(1, 1)); return text; }