Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java problem! Please put two files separately! Thank you Use the following file: RainbowViewer.java import javax.swing.*; public class RainbowViewer { public static void main(String[] args)

Java problem! Please put two files separately! Thank you

image text in transcribed

image text in transcribed

Use the following file:

RainbowViewer.java

import javax.swing.*; public class RainbowViewer { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setSize(300, 400); frame.setTitle("My Rainbow"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); RainbowComponent component = new RainbowComponent(); frame.add(component); frame.setVisible(true); } }
For this problem we are going to draw a "rainbow Getting Set Up You will need some of the graphics classes in your project. Be sure to use the 2D graphics package as explained in your text. You will need to import the necessary classes into your project Project specification Complete the Rainbo Component class The application will draw rainbow will starting at 0.0). The colors will be displayed in rectangles ther than arcs. Each rectangle has width of 100 and a height of 20. There are 7 rectangles. The colors o the first 5 should be made with the pre-defined colors in the Color class. Use red, orange, yellow, green, and blue in that order. The next color is indigo and has RGB values (75, 0, 130). The last rectangle is violet with RGB values of (143, 0, 255). You wll need to construct Color objects using these values This is what the result will look like Rainbowviewer is provided at the Codecheck URI

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions