In Java, How to draw multi-line text with auto-resizing font that must fit into a bounds -


using textlayout , linemeasurer (the way draw multiline center-aligned text in java), how 1 go this?

use jtextpane. can set paragraph attributes "centered" , every line centered within text pane. after create text pane can like:

simpleattributeset center = new simpleattributeset(); styleconstants.setalignment(center, styleconstants.align_center); doc.setparagraphattributes(0, doc.getlength(), center, false); 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -