FileDocCategorySizeDatePackage
LineBreakSample.javaAPI DocExample4331Tue Dec 12 19:00:08 GMT 2000None

LineBreakSample

public class LineBreakSample extends JApplet
This class demonstrates how to line-break and draw a paragraph of text using LineBreakMeasurer and TextLayout. This class constructs a LineBreakMeasurer from an AttributedCharacterIterator. It uses the LineBreakMeasurer to create and draw TextLayouts (lines of text) which fit within the Component's width.

Fields Summary
private LineBreakMeasurer
lineMeasurer
private int
paragraphStart
private int
paragraphEnd
private static final Hashtable
map
private static AttributedString
vanGogh
Constructors Summary
Methods Summary
public voidbuildUI(java.awt.Container container)

        LineBreakPanel lineBreakPanel = new LineBreakPanel();
	container.add(lineBreakPanel, BorderLayout.CENTER);
    
public voidinit()

                                
       
	buildUI(getContentPane());
    
public static voidmain(java.lang.String[] args)


        JFrame f = new JFrame("HitTestSample");
            
        f.addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
                }
            });

        LineBreakSample controller = new LineBreakSample();
	controller.buildUI(f.getContentPane());        
        f.setSize(new Dimension(400, 250));
        f.setVisible(true);