KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > text > TextUtils


1 package snow.text;
2
3 import javax.swing.text.*;
4 import java.util.*;
5
6 public final class TextUtils
7 {
8
9   private TextUtils()
10   {
11
12   } // Constructor
13

14
15   public final static int getPositionInParent(Element elt)
16   {
17     Element parent = elt.getParentElement();
18     for(int i=0; i<parent.getElementCount(); i++)
19     {
20       if(parent.getElement(i)==elt) return i;
21     }
22     return -1;
23   }
24
25
26
27 } // TextUtils
Popular Tags