-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.5, solaris_2.6
Name: vsC58871 Date: 08/20/98
Methods getPartialSpan and getTabbedSpan are missing in
com.sun.java.swing.text.LabelView class, but
they are described in javadoc.
Here is the example demonstrating the bug:
----------------Test.java---------------------
import java.awt.*;
import com.sun.java.swing.text.*;
public class Test {
public static void main(String[] args){
Element element = new StubElement("StubElement");
LabelView lView = new LabelView(element);
lView.getPartialSpan(10,10);
lView.getTabbedSpan(1.0, null);
}
}
class StubElement implements Element {
Document document = new DefaultStyledDocument();
SimpleAttributeSet attr;
String context;
public StubElement(String context) {
this.context = context;
attr = new SimpleAttributeSet();
StyleConstants.setComponent( attr, new Label());
document = new DefaultStyledDocument();
try {
document.insertString(0, context, new SimpleAttributeSet() );
} catch(BadLocationException e) {
}
}
public Document getDocument() {
return document;
}
public Element getParentElement() { return null; }
public String getName() { return "StubElement"; }
public AttributeSet getAttributes() {
return attr;
}
public int getStartOffset() { return 0; }
public int getEndOffset() {
return document.getLength();
}
public int getElementIndex(int offset) {
return 0;
}
public int getElementCount() { return 1; }
public Element getElement(int index) { return this; }
public boolean isLeaf() { return true; }
}
-- The output ----------------
#>java -version
java version "1.2fcs"
Classic VM (build JDK-1.2fcs-F, green threads, sunwjit)
#>javac Test.java
Test.java:8: Method getPartialSpan(int, int) not found in class
com.sun.java.swing.text.LabelView.
lView.getPartialSpan(10,10);
^
Test.java:9: Method getTabbedSpan(double, null) not found in class
com.sun.java.swing.text.LabelView.
lView.getTabbedSpan(1.0, null);
^
2 errors
------------------------------
======================================================================
- duplicates
-
JDK-4180826 HTML viewer: pre tag doesn't render TABs
-
- Closed
-
-
JDK-4191750 JTextPane ignores tabs in JDK 1.2 RC2
-
- Resolved
-