我有一个总noob Java问题: 当使用setText()方法,我得到这个错误Java textBox.setText()错误(太多文字?)
javax.swing.JTextArea[,0,-26524,590x27015,layout=javax.swing.plaf.basic.BasicTextUI$UpdateHandler,alignmentX=0.0,alignmentY=0.0,[email protected],flags=296,maximumSize=,minimumSize=,preferredSize=,caretColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],disabledTextColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],editable=true,margin=javax.swing.plaf.InsetsUIResource[top=0,left=0,bottom=0,right=0],selectedTextColor=sun.swing.PrintColorUIResource[r=51,g=51,b=51],selectionColor=javax.swing.plaf.ColorUIResource[r=184,g=207,b=229],colums=20,columWidth=11,rows=5,rowHeight=15,word=false,wrap=false]
这是我的动作事件
list.setText(list.toString().replaceAll("|3835569365|e49e24d5", ""));
名单是我的JTextArea,这些数字和十六进制还有|是我基本上试图从文本区域删除。
感谢的人:)
这是使用...没有错误 – Doorknob 2013-04-23 01:28:20
我没有在任何地方看到任何错误消息。我看到的只是JTextArea的标准'toString()'表示。也许你想要在JTextArea上调用'getText()'。 – 2013-04-23 01:28:47