Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我要绘制多行文本。文本受宽度限制,它不适合那里,所以我想那里有多少行,即我需要矩形的高度。我在 Java 中有字体变量。我怎样才能做到这一点?
试试这个http://java-sl.com/tip_text_height_measuring.html 如果你在JEditorPane/JTextPane.
JEditorPane/JTextPane
看看测量文本,特别是绘制多行文本