Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

pressing enter(newline) in Jtable cell should increase line(row) height

843807Sep 22 2009 — edited Sep 30 2009
Hi every one,
I am developing an application,which have JTable.In this Jtable row cell,i am writing text,here i want the text to be multiline,for this i used final
JTextArea textArea = new JTextArea(5,20);
        textArea.setWrapStyleWord(true);
        textArea.setLineWrap(true);
editorComponent = textArea;

delegate = new DefaultCellEditor.EditorDelegate() {

            public void setValue(Object value) {
                textArea.setText((value != null) ? value.toString() : "");
            }

            public Object getCellEditorValue() {
                return textArea.getText();
            }
        };
here the text is alingning in mutilines when we press anter but the row height is not increasing.i want to see the entire text writing in that cell same as in excel.
i dont want to use scroll panes.

Thank you very much
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2009
Added on Sep 22 2009
12 comments
1,727 views