Java Swing - O Reilly doc.insertString(offset, “tCenteredn”, null); tabs (Web site counters)
Java Swing - O Reilly doc.insertString(offset, “tCenteredn”, null); tabs = new TabSet(new TabStop[] {center}); StyleConstants.setTabSet(a, tabs); doc.setParagraphAttributes(offset, 1, a, false); offset = doc.getLength(); doc.insertString(doc.getLength(), “t1234.99n”, null); tabs = new TabSet(new TabStop[] {decimal}); StyleConstants.setTabSet(a, tabs); doc.setParagraphAttributes(offset, 1, a, false); offset = doc.getLength(); doc.insertString(doc.getLength(), “tLeftn”, null); tabs = new TabSet(new TabStop[] {left}); StyleConstants.setTabSet(a, tabs); doc.setParagraphAttributes(offset, 1, a, false); offset = doc.getLength(); doc.insertString(doc.getLength(), “tRightn”, null); tabs = new TabSet(new TabStop[] {right}); StyleConstants.setTabSet(a, tabs); doc.setParagraphAttributes(offset, 1, a, false); } catch (BadLocationException ex) {} // Display it JFrame f = new JFrame(); f.addWindowListener(new BasicWindowMonitor()); f.setSize(200, 110); f.setContentPane(tp); f.setVisible(true); } } In this example, we simply created five TabStop objects, one with each of the different alignment values. For each TabStop, we added a line of text, starting with a tab (”t”) and set its TabSet (described next) to a set containing the single TabStop. Figure 21.2 shows how these values are displayed. Figure 21.2. TabStop alignment 21.1.3.3 Leader Constants Table 21.8 shows constants that enumerate the possible ways the space before a tab should be filled. These constants are legal values for the leader property. Currently, changing this property’s value has no effect. Table 21.8, TabStop Leading Constants - 703
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.