Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA FX problem create a new Java class, Board, which extends javafx.Application, that draws a 600x519 pixel window. Set the window title to Board. Draw

JAVA FX problem

create a new Java class, Board, which extends javafx.Application, that draws a 600x519 pixel window. Set the window title to "Board".

Draw a triangle

Create an upright 200x200x200 equilateral triangle within the scene you made in step 1. Use the Polygon class. Make the vertices centered around (0,0), and afterward use setLayoutX() and setLayoutY() to recenter the triangle in the middle of your window. Set the fill color of the triangle to LIGHTGREY.

image text in transcribed

Hint: Relative to the center of the triangle, the apex of the triangle should be at (0.0, -86.6), and the right and left corners of the base should be (100.0, 86.6) and (-100.0, 86.6), where 100 = 200/2 and 86.6 = sqrt((200*200)-(100*100))/2;

Create an inner class

Create an inner class, Triangle, which extends Polygon and has a constructor with signature Triangle(double x, double y, double side). This should create an upright equilateral triangle, centered at (x,y), with sides of length side.

Comment out the code you wrote in step 2 (that drew the triangle with Polygon), and replace it with the creation of a Triangle. Set the fill color of the new triangle to LIGHTGREY. Don't forget to add your triangle to the root group.

Fill the board with triangles

Fill the board with a grid of triangles, storing each triangle in an ArrayList. You should fit exactly three rows (each 173.2 pixels apart), each row having five triangles (three upright and two inverted). You will need to use the setRotate() method to invert some of the triangles.

Create a white border

Reduce the size of each triangle to 196 pixels, while maintaining the spacing as if they were size 200. This should create the effect of a white border around each triangle.

image text in transcribed

Finish up

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_2

Step: 3

blur-text-image_3

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago