How to update JTextArea in Java Swing?

I have a JComboBox named "jComboBox18" and a JTextArea "jTextArea11". Now I want that whenever a item is selected from the "jComboBox18" combo box its corresponding description is shown in the "jTextArea11" textarea. I have added the appropriate listener to the JComboBox But the JTextArea is not showing any text. The code that I have written is as follows: private void jComboBox18ItemStateChanged(java.awt.event.ItemEvent evt) { Object item = jComboBox18.getSelectedItem(); if(item != null) { ems.logic.Process selectedProcess = (ems.logic.Process)item; jTextArea11.setText(selectedProcess.getProcessDescription()); jTextArea11.updateUI(); jTextArea11.revalidate(); jTextArea11.validate(); } } =====================EDITED=========================================== The method is being called for sure. I am changing the state of one more combobox which is also being written in this method and its state changes successfully whenever item is selected from the "jComboBox18"

以上就是How to update JTextArea in Java Swing?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准