У меня есть этот класс:
package com.erikbalen.game.rpg;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class Gui extends JFrame implements ActionListener {
/**
*
*/
private static final long serialVersionUID = -384241835772507459L;
JLabel playerInfo;
JTextField textField;
private final static String newline = "\n";
JTextArea feed;
JScrollPane scrollPane;
Player player;
public Gui() {
super("Erik's RPG");
//setLayout(new FlowLayout());
Container contentPane = this.getContentPane();
contentPane.setLayout(new BoxLayout(contentPane,BoxLayout.PAGE_AXIS));
textField = new JTextField(30);
textField.addActionListener(this);
feed = new JTextArea(15, 30);
feed.setEditable(false);
scrollPane = new JScrollPane(feed);
}
Когда вы запускаете его так, как он это делает, текстовое поле становится действительно высоким, если я его расширяю, хотя я только хочу, чтобы он был определенной высоты. Как я могу