This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I test syntax highlighting in Source Editor for C++ source code. I use Jemmy/Jelly API. I need to recognize colors and font attributes of document elements but I cannot get them. Please, see the following code: import javax.swing.text.*; import org.netbeans.jemmy.operators.*; public class Main_1 { public static void main(String[] args) { JEditorPaneOperator editor = new JEditorPaneOperator(new JFrameOperator(), "public class Main_1"); System.out.println(editor.getDocument().getClass ().getName()); System.out.println(editor.getDocument() instanceof StyledDocument); int position = editor.getPositionByText("public class Main_1"); System.out.println("Position=" + position); Element elem = ((StyledDocument)editor.getDocument ()).getCharacterElement(position + 1); System.out.println("Element=" + elem); System.out.println("ElementName=" + elem.getName ()); System.out.println("Attributes=" + elem.getAttributes()); System.out.println(StyleConstants.getForeground (elem.getAttributes())); } } The getAttributes() method returns null. Can I get attributes in some other way? Product Version: NetBeans IDE 3.5 Beta (Build 20030304) IDE Versioning: IDE/1 spec=3.42 impl 20030304 OS: SunOS 5.8, sparc java version "1.4.1" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21) Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
This is already known problem, it is the duplicate of the issue #31694. It seems the attribute persistency is broken. *** This issue has been marked as a duplicate of 31694 ***