Question: 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

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[]

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!