1 42 43 package org.jfree.demo; 44 45 import java.awt.Font ; 46 47 import javax.swing.JPanel ; 48 49 import org.jfree.ui.ApplicationFrame; 50 import org.jfree.ui.RefineryUtilities; 51 52 57 public class TextBlockDemo extends ApplicationFrame { 58 59 64 public TextBlockDemo(final String title) { 65 super(title); 66 setContentPane(createContentPane()); 67 } 68 69 70 75 private JPanel createContentPane() { 76 final JPanel content = new TextBlockPanel("This is some really long text that we will use " 77 + "for testing purposes. You'll need to resize the window to see how the TextBlock " 78 + "is dynamically updated. Also note what happens when there is a really long " 79 + "word like ABCDEFGHIJKLMNOPQRSTUVWXYZ (OK, that's not really a word).", 80 new Font ("Serif", Font.PLAIN, 14)); 81 return content; 82 } 83 84 89 public static void main(final String [] args) { 90 91 final TextBlockDemo demo = new TextBlockDemo("TextBlock Demo"); 92 demo.pack(); 93 RefineryUtilities.centerFrameOnScreen(demo); 94 demo.setVisible(true); 95 96 } 97 98 } 99 | Popular Tags |