RTP console method + MouseListener = ???
Author |
Message |
cpstorm
|
Posted: Tue Jun 12, 2012 1:18 pm Post subject: RTP console method + MouseListener = ??? |
|
|
Trying to use Ready To Program console method in conjunction with a mouseListener. Apparently the console method ignores the mouselistener. For example:
// The "T" class.
import java.awt.*;
import hsa.Console;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;
public class T implements MouseListener
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console ();
// Place your program here. 'c' is the output console
} // main method
public void mousePressed (MouseEvent e)
{
c.println ("pressed. x:" + e.getX () + ", y: " + e.getY ());
}
public void mouseReleased (MouseEvent e)
{
c.println ("count:" + e.getClickCount ());
}
public void mouseEntered (MouseEvent e)
{
}
public void mouseExited (MouseEvent e)
{
c.println ("Mouse exited");
}
public void mouseClicked (MouseEvent e)
{
c.println ("Mouse clicked (# of clicks: " + e.getClickCount ());
} // T class
} |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DemonWasp
|
Posted: Wed Jun 13, 2012 9:13 pm Post subject: RE:RTP console method + MouseListener = ??? |
|
|
Your example program never does anything with the MouseListener. The Console doesn't magically know about the MouseListener, you have to tell it with an addListener() method or similar (I don't recall anything of the sort).
I'm not even sure combining java.awt.MouseListener with hsa classes works, having never done it myself. |
|
|
|
|
|
|
|