Hi,
is there a possibility to get the pressed mousebutton in the ChartMouseListener-event? (left- middle, right-button)
thanks
juergen
ChartMouseListener() and mousebutton
Re: ChartMouseListener() and mousebutton
... and how can i get the mouseposition on screen in the event?
ju
ju
Re: ChartMouseListener() and mousebutton
Hi Juergen,
The following code seems to work fine for me here:
The following code seems to work fine for me here:
Code: Select all
tChart1.addChartMouseListener(new ChartMouseListener() {
@Override
public void titleClicked(ChartMouseEvent e) { }
@Override
public void legendClicked(ChartMouseEvent e) { }
@Override
public void backgroundClicked(ChartMouseEvent e) {
String s;
switch (e.getButton()) {
case FrameworkMouseEvent.BUTTON1: s = "Left Button";
break;
case FrameworkMouseEvent.BUTTON2: s = "Middle Button";
break;
case FrameworkMouseEvent.BUTTON3: s = "Right Button";
break;
default: s = "No Button";
break;
}
tChart1.getHeader().setText(s);
}
@Override
public void axesClicked(ChartMouseEvent e) { }
});
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: ChartMouseListener() and mousebutton
I'm sorry, it does not work. The "getButton()"-function from the ChartMouseEvent is not accepted. May be my TeeChart version (2008) ist to old?
juergen
juergen
Re: ChartMouseListener() and mousebutton
Hi Juergen,
Excuse me, my fault.
You are right, this has been added in TeeChart Java v3.
Excuse me, my fault.
You are right, this has been added in TeeChart Java v3.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |