bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/23016] swing: StringIndexOutOfBoundsException with JTabbe


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/23016] swing: StringIndexOutOfBoundsException with JTabbedPane.setMnemonicAt
Date: 8 Sep 2010 18:04:50 -0000

Steps to reproduce:
1. Compile and run the attached testcase.

Expected results:
1. An empty window shows up.

Actual results:
1. No window is shown and the program throws the following exception:
Exception during event dispatch:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.charAt (String.java:548)
   at javax.swing.JTabbedPane$Page.setDisplayedMnemonicIndex
(JTabbedPane.java:526)
   at javax.swing.JTabbedPane$Page.setMnemonic (JTabbedPane.java:499)
   at javax.swing.JTabbedPane$Page.setMnemonic (JTabbedPane.java:486)
   at javax.swing.JTabbedPane.setMnemonicAt (JTabbedPane.java:1361)
   at com.cep.jqemu.JQEMU.<init> (JQEMU.java:59)
   at com.cep.jqemu.JQEMU$5.run (JQEMU.java:252)
   at java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:191)
   at java.awt.EventQueue.dispatchEvent (EventQueue.java:508)
   at java.awt.EventDispatchThread.run (EventDispatchThread.java:75)

Testcase:
import javax.swing.*;
import java.awt.*;
public class testcase extends JFrame {
        public static void main(String[] args) {
                (new testcase()).show();
        }
        public testcase() {
                JTabbedPane configPane = new JTabbedPane();
                JPanel stdPanel = new JPanel();
                configPane.addTab("Standard", stdPanel);
                configPane.setMnemonicAt(0, '1');
                this.setSize(new Dimension(400,400));
        }
}

This testcase has been reduced from JQEMU available at
http://sourceforge.net/projects/jqemu/


------- Comment #1 from from-classpath at savannah dot gnu dot org  2005-07-06 
21:51 -------
This bug doesn't seem to happen with cvs HEAD anymore.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23016




reply via email to

[Prev in Thread] Current Thread [Next in Thread]