Suite à une exception qui est levée, mais qui ne perturbe pas l'application, j'ai fait un bug report...
Après avoir cherché, j'ai isolé un TestCase qui permet de mettre en évidence le bug...
Apparemment, le bug n'apparait que sur java 6 beta, et ce test fonctionnerait sur java 5... (le bug similaire de mon appli fonctionnait sur java5)
Je souhaiterais que qqn le teste sous java 5 svp (je n'ai pas envie de l'installer, pr éviter d'éventuels conflits avec java6).
L'exception levée (souvent, mais pas tout le temps):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 package bug779907; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTabbedPane; import javax.swing.SwingUtilities; /** * TestCase for JAVA SE6 BUG ID 779907. * * @author rom1v */ public class BugTestCase { public static void main(String... args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame(); frame.setBounds(100, 100, 300, 300); final JTabbedPane tabbedPane = new JTabbedPane(); frame.getContentPane().add(tabbedPane); /* It's a particular case, but I think it should work correctly. */ new Thread() { @Override public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { tabbedPane.setTabComponentAt(tabbedPane.getTabCount() - 1, new JLabel("tab")); tabbedPane.setSelectedIndex(0); } }); } }.start(); frame.setVisible(true); } }); } }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -1 at java.util.Vector.elementAt(Unknown Source) at javax.swing.JTabbedPane.getTabComponentAt(Unknown Source) at javax.swing.JTabbedPane.setTabComponentAt(Unknown Source) at bug779907.BugTestCase$1$1$1.run(BugTestCase.java:31) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
Partager