Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LISTING 14.19 ShowPolygon.java 1 import javax application Application: 2 sport javax.collections Observablelist: mport javax.scene Scene #mport javax scene layout Pane 5 sport java.scene paint.Color import

image text in transcribed
LISTING 14.19 ShowPolygon.java 1 import javax application Application: 2 sport javax.collections Observablelist: mport javax.scene Scene #mport javax scene layout Pane 5 sport java.scene paint.Color import javax. stage. Stage 1 Import javax.scene shape. Polygon puble class ShowPolygon extends Application 10 Override over the start method in the Applications public void start (Stage primarystage) 12 Il create scene place in the stage 13 Scane scene new Scene new MyPolygont). 100.400) 14 primarystage settle helpoll set the stage title 15 primaryStage. set Scene cene): Place the scene in the stage 16 primary stage show(): Display the stage 17 18) 19 20 clase MyPolygon extends Pare 21 private void paint() 22 Create polyplace polygon to pene 23 Polygon polypon new Polygon() 25 polygon, sotstroke (Color BLACK) 20 ObservableListDouble et polypongetotna) 27 28 double centarx getwidth center - getight 29 double radius Nathan (get) geheight: 30 31 Au points to the polypon at 32 33 for (int 10:1510) Tistad (center radius. Math.cos 34 11.add(centery - radius Math in Math 1) 35 36 37 getChildren().clear() 38 getchildren), odpolygon) 39 40 41 Override 42 bile voldoende ble with 43 super seithwidth): paint: 46 Override 48 Dublic void setteont (double meight) 49 super steight (night) 50 paint 51 52) 7. Task 2 Update the program in Task 1 to display a polyline as shown in the figure below. ShowPolygon fox

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

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions