PROG24178 Lecture 12: Event Handler Lecture Notes

119 views7 pages

Document Summary

It is something done by the user to the gui, ie upon event like a button click or a resizing or mouse over it causes a message to be sent to an object like an alert box. Using event handling is referred to as event-driven programming. * and open the template in the editor. package eventhandlingexample; //import eventhandlingexample. eventhandlingexample. addcircle; import javafx. application. application; import javafx. event. actionevent; import javafx. event. eventhandler; import javafx. scene. scene; import javafx. scene. control. button; import javafx. scene. layout. hbox; import javafx. scene. layout. stackpane; import javafx. scene. paint. color; import javafx. scene. shape. circle; @override public void start(stage primarystage) { pane. setspacing(20);//my spacing is 20px pane. getchildren(). add(new thecircle(100));//the constructor now has a width of 100px for. /* public int getradius(int radius) { return radius; //assign radius to getradius public void setradius(int radius) { this. radius = radius; //use the int param to set radius of the circle object public thecircle(int radius) { //constructor takes an int as a parameter and i chose to make the constructor public.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents