任务单 #20003

javax.swing.text StyledDocument Does not display

开放日期: 2009-12-25 18:32 最后更新: 2009-12-31 14:21

报告人:
属主:
类型:
状态:
开启 [Owner assigned]
里程碑:
(无)
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Accepted
文件:

Details

javax.swing.text StyleDocument does not display text. The screen is blank on HTC Tilt2. Runs fine on computer. Same issue will all applications that use StyledDocuments.

任务单历史 (3/5 Histories)

2009-12-25 18:32 Updated by: bdwinsalt
  • New Ticket "javax.swing.text StyledDocument Does not display" created
2009-12-26 22:55 Updated by: freebeans
  • 处理结果 Update from to Accepted
  • 属主 Update from (无) to freebeans
评论

Thank you for your bug report. I'll investigate the cause of this problem. Would you send me a sample source to reproduce it, please?

2009-12-27 00:54 Updated by: freebeans
  • 优先 Update from 3 to 5 - Medium
2009-12-27 04:40 Updated by: bdwinsalt
评论

public static JTextPane chatText = null;

...

chatText = new JTextPane();

...

public static void append(Color c, String s) {
StyleContext sc = StyleContext.getDefaultStyleContext(); AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY,
StyleConstants.Foreground, c);
int len = chatText.getDocument().getLength(); // same value as getText().length(); chatText.setCaretPosition(len); // place caret at the end (with no selection) chatText.setCharacterAttributes(aset, false);
chatText.setEditable(true); // Won't print text unless it's enabled
chatText.replaceSelection(s); // Adds the new line (with Color)
chatText.setEditable(false); // Disable so you can't backspace chat. }
2009-12-31 14:21 Updated by: freebeans
  • 里程碑 Update from jvm0.4.7 to (无)
评论

Thank you. I can reproduce the problem with your code, and I found a bug in JVM. (Bug #20056) I'll fix it.

Attachment File List

No attachments

编辑

Please login to add comment to this ticket » 登录名