Keep BoxLayout From Expanding Children
问题 I want to stack some JComponents vertically inside a JPanel so they stack at the top and any extra space is at the bottom. I'm using a BoxLayout. The components will each contain a JTextArea that should allow the text to wrap if necessary. So, basically, I want the height of each of these components to be the minimum necessary for displaying the (possibly wrapped) text. Here's a contained code example of what I'm doing: import javax.swing.*; import java.awt.*; public class TextAreaTester {