Write a graphics program that draws 12 strings, one each for the 12 standard colors, besides Color.WHITE, each in its own color. Provide a class ColorNameViewer and a class ColorNameComponent.
Here is a sample program output:
Complete the following file:
Use the following file:
ColorNameViewer.java
import javax.swing.*; /** Shows a frame with the standard color names. */ public class ColorNameViewer { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setSize(300, 400); frame.setTitle("ColorNameViewer"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ColorNameComponent component = new ColorNameComponent(); frame.add(component); frame.setVisible(true); } }