Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 RTP console method + MouseListener = ???
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cpstorm




PostPosted: 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
Sponsor
sponsor
DemonWasp




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: