acm.graphics

What is the syntax for a mouseListener when using acm.graphics

不问归期 提交于 2019-12-11 11:42:36
问题 I have a "button" which is just a GRect from the ACM Graphics Library. It has an inherited method addMouseListener which I have tried (and failed) using. I need to know the syntax so that when someone clicks on the "button" I can invoke another method which resides in the same class. I want to know: Is it ButtonName.addMouseListener or addMouseListener(ButtonName) Can I put the line mentioned above right after I create the button? What is the syntax that allows a click on the button to call