Question
Programming Characters Around a Circle - Write in Java and include comments Write a program that displays a string Welcome to Java around the circle,
Programming Characters Around a Circle - Write in Java and include comments
Write a program that displays a string Welcome to Java around the circle, as shown below. You need to display each character in the right location with appropriate rotation using a loop.
Directions
Create a class named Characters extends Application.
Create a new pane.
Create an object of Font class and define font features as bold, Times New Roman, regular and size of 35.
Create a string of Welcome to Java
Create a for loop to scan through each character of Welcome to Java string.
Inside the for loop, create an instance of Text on the given coordinates containing the given characters by use constructor of Text(double x, double y, java.lang.String text)
Use setFont( ) and setRotate( ) methods of Text class to define characters and their rotated positions
Add text instance to the pane by using getChildren().add() method
Create a scene with a specific size
Set title to Characters around circle and display the stage
The output should look like the screen below.
Provide appropriate Java comments
Grading Rubric
Task | Points |
Create user interface using Scene, Pane and Stage | 2 |
Use Font class correctly to set up font style and size | 3 |
Use for loop correctly to scan through each character of the string | 2 |
Use methods of Text class to set font and rotate characters | 3 |
The output for Characters Around Circle is correct and looks like the sample screen | 2 |
Total | 12 |
Screenshots
This is to build a GUI basics
AVA WOStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started