Package javax.swing.text

Examples of javax.swing.text.TabStop


        int charWidth = fm.charWidth('w');
        int tabWidth = charWidth * charactersPerTab;
        TabStop[] tabs = new TabStop[10];
        for (int j = 0; j < tabs.length; j++) {
            int tab = j + 1;
            tabs[j] = new TabStop(tab * tabWidth);
        }
        return tabs;
    }
View Full Code Here


      for(MutableAttributeSet s: all) { StyleConstants.setFontFamily(s, fontName);  StyleConstants.setFontSize(s, fontSize); }
      do_reapplyAll();
      BufferedImage im = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB); // this is used to derive the tab width
      int gap = tabSize * im.createGraphics().getFontMetrics(new Font(fontName, Font.PLAIN, fontSize)).charWidth('X');
      TabStop[] pos = new TabStop[100];
      for(int i=0; i<100; i++) { pos[i] = new TabStop(i*gap + gap); }
      StyleConstants.setTabSet(tabset, new TabSet(pos));
      setParagraphAttributes(0, getLength(), tabset, false);
   }
View Full Code Here

TOP

Related Classes of javax.swing.text.TabStop

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.