简体   繁体   中英

how to make an auto line break in jtable?

hi I'm using java jtable

 dff[i] = new DefaultTableModel(
                        new Object[][] {
                            {"ID",tab[i].get("id")},
                            {"Titre",tab[i].get("title")},
                            {"Auteur",tab[i].get("authors")},
                            {"Date",tab[i].get("date")},
                            {"Resume","Substitution ciphers are codes in which each letter of the alphabet has one fixed substitute, and the word divisions do not change.."},
                        },
                        new String[] {
                            "New column",""
                        }
                    );

             jj[i]= new JTable(dff[I]); 

but I'm getting

https://i.stack.imgur.com/sCuNn.png

I wanna add an auto break line in the abstract part if it's possible

thank you so much camickr I added <HTML> <p> and its work

tab[i].get("abstract")="Substitution ciphers are codes in which each letter of the alphabet has one fixed substitute, and the word divisions do not change.";

{"Resume","<html><p>"+tab[i].get("abstract")+"</p></html>"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM