[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bug #13247] swing: calling JMenu.add twice with same argume
From: |
Timo Lindfors |
Subject: |
[commit-cp] [bug #13247] swing: calling JMenu.add twice with same argument throws ArrayIndexOutOfBoundsException |
Date: |
Tue, 31 May 2005 18:51:12 +0000 |
User-agent: |
Elinks |
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13247>
Summary: swing: calling JMenu.add twice with same argument
throws ArrayIndexOutOfBoundsException
Project: classpath
Submitted by: lindi
Submitted on: Tue 05/31/05 at 18:51
Category: classpath
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Platform Version: None
_______________________________________________________
Details:
Steps to reproduce:
1. Compile and run the attached testcase.
Expected results:
1. A window shows up. It has "menu0" which contains "menuitem0".
Actual results:
1. No window is shown and the following exception is thrown:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.VMSystem.arraycopy (Native Method)
at java.lang.System.arraycopy (System.java:234)
at java.awt.Container.addImpl (Container.java:370)
at java.awt.Container.add (Container.java:307)
at javax.swing.JPopupMenu.insert (JPopupMenu.java:268)
at javax.swing.JPopupMenu.add (JPopupMenu.java:179)
at javax.swing.JMenu.add (JMenu.java:153)
at jmenu.<init> (jmenu.java:14)
at jmenu.main (jmenu.java:5)
Testcase:
import javax.swing.*;
import java.awt.*;
public class jmenu extends JFrame {
public static void main(String[] args) {
(new jmenu()).show();
}
public jmenu() {
JMenuBar mb = new JMenuBar();
this.setJMenuBar(mb);
JMenu m = new JMenu("menu0");
mb.add(m);
JMenuItem mi = new JMenuItem("menuitem0");
m.add(mi);
m.add(mi);
this.setSize(new Dimension(600, 600));
}
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13247>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [commit-cp] [bug #13247] swing: calling JMenu.add twice with same argument throws ArrayIndexOutOfBoundsException,
Timo Lindfors <=