MouseWheelListener in JFrame that was created in java does not work
Mostrar comentarios más antiguos
Hi all,
I have a java class with a constructor that receives some java model object. The class extends JFrame and visualizes the model. There is a MouseWheelListener to allow zooming into the model visualization.
public class myGUI extends JFrame {
public myGUI(myModelClass model) {
add(new modelCanvas(model));
}
}
public class modelCanvas extends JPanel {
private myModelClass model;
public modelCanvas(myModelClass model) {
this.model = model;
addMouseWheelListener(new myMouseWheelListener());
}
public void paintComponent(java.awt.Graphics g) {
// paints the model canvas
}
}
All works well when myGUI is invoked from java. As soon as I create a myModelClass in matlab and create a myGUI from it, 2 things happen:
- Look-and-feel is different, which is ok.
- The MouseWheelListener does not work, which renders the visualization useless.
Is there a way to circumvent the 2nd issue?
Wouter
Respuestas (1)
Wouter
el 25 de Nov. de 2011
0 votos
Categorías
Más información sobre Model Predictive Control Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!