-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
sparc
-
solaris_2.6
Name: nkR10003 Date: 10/23/2000
JavaDoc comments for LabelView.setUnderline states:
"Set whether or not the view is underlined." Also
JavaDoc comments for LabelView.isUnderline states:
"Determine if the glyphs should be underlined....."
So after the call to setUnderline(true), method
isUnderline should return true. Actually it returns false.
The same problem appears with methods from the list below:
Methods list:
protected void setUnderline(boolean u)
protected boolean isUnderline()
protected void setStrikeThrough(boolean s)
protected boolean isStrikeThrough()
protected void setSuperscript(boolean s)
protected boolean isSuperscript()
protected void setSubscript(boolean s)
protected boolean isSubscript()
Example below demonstrates this problem:
------------------example--------------------
//test.java
import javax.swing.text.*;
import javax.swing.*;
public class test {
public static void main(String[] args) {
DefaultStyledDocument doc = new DefaultStyledDocument();
Element element = doc.getDefaultRootElement();
UnderlineView view = new UnderlineView(element);
if (!view.isUnderline()) {
System.out.println("is underline: " + view.isUnderline());
System.out.println("Test failed");
System.exit(1);
}
System.out.println("Test passed");
System.exit(0);
}
}
class UnderlineView extends LabelView {
public UnderlineView(Element element) {
super(element);
setUnderline(true);
}
}
----------------output:----------------------
is underline: false
Test failed
---------------------------------------------
======================================================================
- duplicates
-
JDK-4374369 Clarification of LabelView properties
-
- Resolved
-