我需要在我的JTextArea中出现一个垂直滚动条,只有在需要时才会出现,为此,我知道我需要根据需要使用垂直滚动条。但是滚动条不断出现,就像这样:
// make default text message to be displayed in top panel
output = new JTextArea
我有一个不可编辑的JTextArea。我希望这个JTextArea的大小不超过包含它的文本所需的大小。但是,如果我展开包含它的组件,JTextArea也会展开,留下恼人的空白。包含JTextArea的容器正在使用BoxLayout。BoxLayout.PAGE_AXIS));
this.add(header);
this.setDescription();//This is the JTextAreathis.setBod