bonjour,
lors de l'execution de mon programme j'ai l'erreur suivante:
ça n'est apparu qu'apres ajout de ces lignes:CANVAS CRASHED!!!
CANVAS CRASHED!!!
CANVAS CRASHED!!!
CANVAS CRASHED!!!
CANVAS CRASHED!!!
CANVAS CRASHED!!!
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at jGMSHPack.jGMSHPane.Container3DMouseMoved(jGMSHPane.java:447)
at jGMSHPack.jGMSHPane.access$300(jGMSHPane.java:27)
at jGMSHPack.jGMSHPane$3.mouseMoved(jGMSHPane.java:185)
at java.awt.Component.processMouseMotionEvent(Component.java:6145)
at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3283)
at com.sun.j3d.exp.swing.JCanvas3D.processMouseMotionEvent(JCanvas3D.java:498)
at java.awt.Component.processEvent(Component.java:5869)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4472)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4302)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3999)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
[...]
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
43
44
45
46
47
48
49
50 private void SelectButtonActionPerformed(java.awt.event.ActionEvent evt) { //Booleans: SelectBo=true; RotateBo=false; ZoomBo=false; SlideBo=false; //Cursor: setCursor(SelectCursor); } private void ZoomButtonActionPerformed(java.awt.event.ActionEvent evt) { //Booleans: SelectBo=false; RotateBo=false; ZoomBo=true; SlideBo=false; //Cursor: setCursor(ZoomCursor); } private void RotateButtonActionPerformed(java.awt.event.ActionEvent evt) { //Booleans: SelectBo=false; RotateBo=true; ZoomBo=false; SlideBo=false; //Cursor: setCursor(RotateCursor); } private void SlideButtonActionPerformed(java.awt.event.ActionEvent evt) { //Booleans: SelectBo=false; RotateBo=false; ZoomBo=false; SlideBo=true; //Cursor: setCursor(SlideCursor); } [...] SelectIc=(new javax.swing.ImageIcon(getClass().getResource("/image/select.PNG"))).getImage(); RotateIc=(new javax.swing.ImageIcon(getClass().getResource("/image/rotate.PNG"))).getImage(); ZoomIc=(new javax.swing.ImageIcon(getClass().getResource("/image/zoom.PNG"))).getImage(); SlideIc=(new javax.swing.ImageIcon(getClass().getResource("/image/slide.PNG"))).getImage(); Toolkit tk = Toolkit.getDefaultToolkit(); SelectCursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR); RotateCursor = tk.createCustomCursor(RotateIc, new Point(25, 25), ""); ZoomCursor = tk.createCustomCursor(ZoomIc, new Point(25, 25), ""); SlideCursor = tk.createCustomCursor(SlideIc, new Point(25, 25), "");
Partager