I have a simple class that draws a box on the screen I'm trying to figure out how to attach click event listeners to the class and I seem to be failing miserably. I want to have a text box show up in a location relative to the box when an instance of it is clicked in the applet but i cant seem to get mousePressed() or mousePressed == true to work in the class. any suggestions?
this is my code. ignore the xml part that seems to be working as i want it for now.
//a variable holding an instance of a custom class Box i called oopbox
Box oopbox;
XMLElement xml;
XMLElement[] numOfNodes;
void setup(){
size(500,400);
background(0xffffff);
xml = new XMLElement(this, "http://images.apple.com/main/rss/hotnews/hotnews.rss");
//print(xml);
numOfNodes = xml.getChildren("channel/item/description");
//print(numOfNodes[0].getContent());
for (int i = 0; i< numOfNodes.length; i++){
//print(numOfNodes[i].getContent() + "\n\n");
oopbox = new Box(10, 10, int(random(width)/2), int(random(height)));
}