Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 4 0 1 3 1 0 3 - 4 ADVANCED PROGRAMMING Ex 2 : Event - Driven Programming Lab Objectives: To know how to

14013103-4
ADVANCED PROGRAMMING
Ex2: Event-Driven Programming
Lab Objectives:
To know how to deal with different types of Events on different UI Controls.
To know how to use Lambda expression to register the handler with the source object.
14U15105-4
ADVANCED PROGRAMMING
Ex2: Event-Driven Programming
Design the previous GUI using JavsaFX then perform all the following events:
Actions
1- Change the fill color of the squares or the circle that painted in the pane.
Let the user choose the shape from the ComBobox
Change the color of the selected shape using the RadioButton
3- Add a white Stroke around the selected shape (from the ComboBox) if the user select the "Add Stroke?" CheckBox and remove the stroke if the user unselect the CheckBox.
3- Reset the color for all the shapes to Black and the Stroke of the circle to white if the user clicks on the "Reset colors" Button.
4- Add a KeyEvent that moves the circle left, right, up and down using the keyboard arrows.
5- Add a MouseEvent on the pane of the shapes. If the user clicks on any free space within the pane border, the background color of the pane will be changed to "black" color.
Event type
ActionEvent on the RadioButton(s).
ActionEvent on the "Add Stroke?" CheckBox
ActionEvent on the "Reset colors" Button
KeyEvent on the scene or root and make the focus on the circle.
MouseEvent on the pane.
Extra:
Try to let the user choose the shape by mouse instead of select it from the ComboBox then change the color and Stroke after that.
Hint:
Use an object from Pane layout to move the circle using the keyboard arrows.
Use method consume() from the KeyEvent class to prevent the default KeyEvent processed on the ComboBox control.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

derive modelling equation for cooling towers

Answered: 1 week ago

Question

1. Define the nature of interviews

Answered: 1 week ago

Question

2. Outline the different types of interviews

Answered: 1 week ago