簡體   English   中英

如何在 jtable 中進行自動換行?

[英]how to make an auto line break in jtable?

嗨,我正在使用 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]); 

但我得到

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

如果可能的話,我想在抽象部分添加一條自動換行符

非常感謝 camickr 我添加了<HTML> <p>及其工作

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>"}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM