Bonjour
J'utilise JOGL dans mon application. Je voudrais implémenter un KeyListener pour manipuler au clavier ma visualisation.
Voici succinctement le code de ma classe pour la visualisation:
Et voici comment je construis cet élément dans ma fenêtre principale:
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
Le problème est que rien ne se passe lorsque je tape sur le clavier.
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24private void changeGLJPanel(CompleteGraph cg) { Date start = new Date(); this.gljPanel.removeGLEventListener(this.glel); this.mainPanel.remove(0); this.gljPanel = null; this.glel = null; this.jScrollPane = null; System.gc(); this.gljPanel = new GLJPanel(); animator = new Animator(gljPanel); glel = new NetworkRenderer(cg, animator, this); gljPanel.addGLEventListener(glel); gljPanel.setFocusable(true); /*KeyListener kl = (KeyListener)glel; gljPanel.addKeyListener(kl);*/ //this.jScrollPane = new JScrollPane(this.gljPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); //this.mainPanel.add(this.jScrollPane, BorderLayout.CENTER); this.mainPanel.add(this.gljPanel, BorderLayout.CENTER); this.mainPanel.updateUI(); Date end = new Date(); long time = end.getTime()-start.getTime(); System.out.println("Displaying time: "+time+" ms"); }
J'ai manqué quelque chose ? Je précise que j'ai implémenter dans ma classe NetworkRenderer mes listeners avec la souris et tout fonctionne. J'ai choisi de ne pas les afficher ici.
Merci d'avance.
@++

 

 
		
		 
         
 

 
			
			

 
  
  
 
 
			 
   
 


 [JOGL] KeyListener et GLCanvas
 [JOGL] KeyListener et GLCanvas
				 Répondre avec citation
  Répondre avec citation
Partager