Ticket #20003

javax.swing.text StyledDocument Does not display

오픈 날짜: 2009-12-25 18:32 마지막 업데이트: 2009-12-31 14:21

Reporter:
소유자:
Type:
Status:
Open [Owner assigned]
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Accepted
File:
None

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.

Ticket History (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
  • Resolution Update from None to Accepted
  • 소유자 Update from (None) 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
  • Priority 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
  • Milestone Update from jvm0.4.7 to (None)
댓글 올리기

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

Edit

Please login to add comment to this ticket » Login