Bug 24523 - JTextPane doesent work, gives error.
Summary: JTextPane doesent work, gives error.
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: 0.19
: P2 normal
Target Milestone: 0.91
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-25 17:06 UTC by Beat Wolf
Modified: 2006-05-03 10:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-11-04 20:33:19


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Beat Wolf 2005-10-25 17:06:07 UTC
If you start this application you will get a error.

package main;

import java.awt.Dimension;

import javax.swing.*;        

public class Swing {
    private static void createAndShowGUI() {

        JFrame frame = new JFrame("HelloWorldSwing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JTextPane jTextpane = new JTextPane();
        frame.add(jTextpane);
        frame.setSize(new Dimension(600, 450));       
        frame.setVisible(true); 
    }

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
            }
        });
    }
}

error:
jamvm main.Swing
Exception during event dispatch:
java.lang.AssertionError: No child views found where child views are expected. pos = 0, bias = forward
   at javax.swing.text.CompositeView.modelToView (CompositeView.java:234)
   at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView (BasicTextUI.java:274)
   at javax.swing.plaf.basic.BasicTextUI.modelToView (BasicTextUI.java:942)
   at javax.swing.plaf.basic.BasicTextUI.modelToView (BasicTextUI.java:917)
   at javax.swing.text.JTextComponent.modelToView (JTextComponent.java:1548)
   at javax.swing.text.DefaultCaret.paint (DefaultCaret.java:581)
   at javax.swing.plaf.basic.BasicTextUI.paintSafely (BasicTextUI.java:802)
   at javax.swing.plaf.basic.BasicTextUI.paint (BasicTextUI.java:779)
   at javax.swing.plaf.ComponentUI.update (ComponentUI.java:192)
   at javax.swing.JComponent.paintComponent (JComponent.java:1627)
   at javax.swing.JComponent.paint (JComponent.java:1527)
   at javax.swing.JComponent.paintChildren (JComponent.java:1595)
   at javax.swing.JComponent.paint (JComponent.java:1529)
   at javax.swing.JComponent.paintChildren (JComponent.java:1595)
   at javax.swing.JComponent.paint (JComponent.java:1529)
   at javax.swing.JLayeredPane.paint (JLayeredPane.java:686)
   at javax.swing.JComponent.paintChildren (JComponent.java:1595)
   at javax.swing.JComponent.paint (JComponent.java:1529)
   at javax.swing.JComponent.paintDoubleBuffered (JComponent.java:1720)
   at javax.swing.JComponent.paint (JComponent.java:1522)
   at java.awt.Container$GfxPaintVisitor.visit (Container.java:1817)
   at java.awt.Container.visitChild (Container.java:1621)
   at java.awt.Container.visitChildren (Container.java:1583)
   at java.awt.Container.paint (Container.java:769)
   at javax.swing.JFrame.update (JFrame.java:282)
   at gnu.java.awt.peer.gtk.GtkComponentPeer.handleEvent (GtkComponentPeer.java:315)
   at java.awt.Component.dispatchEventImpl (Component.java:4846)
   at java.awt.Container.dispatchEventImpl (Container.java:1644)
   at java.awt.Window.dispatchEventImpl (Window.java:623)
   at java.awt.Component.dispatchEvent (Component.java:2341)
   at java.awt.EventQueue.dispatchEvent (EventQueue.java:474)
   at java.awt.EventDispatchThread.run (EventDispatchThread.java:75)
Comment 1 Audrius Meškauskas 2005-11-04 20:33:19 UTC
Confirmed for 0.19 (JamVM 1.3.3). Our exception matches and the Sun's 1.5 implementation works with that test case.
Comment 2 Roman Kennke 2006-05-03 10:55:18 UTC
This seems to be fixed some time ago.