I cant view .java files on the phone but i suspect you haven't used a validate(); call.. This kind of operation is not thread safe so I'm not surprised it doesent work. But here's a walkaround: use textarea.setPrefferedSize(new Dimension(1,1)); for the not viewable text area and then call the same method with the parameters 450,450(viewable text area), for example.. To add a scrollbar you just do add(new JScrollPane(textArea));