我有一个具有JTextArea字段的对象ReminderGUI。ReminderGUI代表了一个可以保存和显示提醒的应用程序。当点击getReminderButton时,我希望应用程序找到之前为这个日期保存的提醒,并将其显示在JTextArea中(我不会在代码片段中显示此功能)。我在更改JTextArea文本时遇到了问题,下面的代码演示了这一点。一旦单击了getReminderButton,getReminderButtonHandler()就会初始化一个新的空白JTextArea,然后将其附加到some new text
在使用JTextArea时遇到了一些麻烦,特别是它的伸缩性。每当我试图重新调整指令区域的大小时,它确实会与我所有的其他组件打乱。instructions; private JComboBox menubox, seasonalmenubox; instructions = new JLabel("List Any Special Instructions:"); instructions
我在调整JTextArea在java.swing中的大小时遇到了问题。问题是,一旦当前行完成(例如,如果我继续按空格)--它不会转到第二行--它只是继续前进。同样的事情,当我按回车-它延伸的盒子垂直。JTextArea MainText = new JTextArea();MainText.setBorder
在面板上,我为图片添加了一个JLabel,为文本添加了几个JTextArea (setEditable,setCursor,setOpaque,setFocusable to false)。如果我将JTextArea更改为JLabel,它可以工作,但我使用JTexArea的原因是因为我想要/需要wordwrap。有什么建议吗?谢谢。
public class TextEditor extends JFrame implements ActionListener{JButton calculatorButtonthis.pack(); // TODO Auto-generated method stub
textArea = new JTextArea