Write a program brighterdemo that constructs a color object

Assignment Help JAVA Programming
Reference no: EM13339969

In the Java library, a color is specified by its red, green, and blue components between 0 and 255. Write a program BrighterDemo that constructs a Color object with red, green, and blue values of 50, 100, and 150. Then apply the brighter method and print the red, green, and blue values of the resulting color. (You won't actually see the color-see the next exercise on how to display the color.) but place your code into the following class. Then the color will be displayed.
import java.awt.Color;
import javax.swing.JFrame;
public class BrighterDemo
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
frame.setSize(200, 200);
Color myColor = ...;
frame.getContentPane().setBackground(myColor);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

Reference no: EM13339969

Questions Cloud

Write a program that displays a frame window w pixels wide : Write a program that displays a frame window W pixels wide and H pixels high. Use the Scanner to enter the values for W and H. The title of the frame is also entered by the user.
What is the cross-sectional area of the solenoid : a solenoid with length of 2.71 m and N= 311 turns/m carries a current 2.63 A. It stores 2.57 J of energy. What is the cross-sectional area of the solenoid
Compute the absolute pressure at the bottom of the container : A container is filled to a depth of 21.0 cm with water. What is the absolute pressure at the bottom of the container
Explain why the length and severity of the great depression : Assume that the demand for autoworkers declines significantly due to a decrease in demand for new automobiles. Explain what will happen to unemployment using both classical and Keynesian reasoning.
Write a program brighterdemo that constructs a color object : In the Java library, a color is specified by its red, green, and blue components between 0 and 255. Write a program BrighterDemo that constructs a Color object with red, green, and blue values of 50, 100, and 150.
Find the wavelength of the photon emitted : An electron drops from the 8 to the 6 level of an infinite square well 1.5 nm wide. Find the wavelength of the photon emitted
Find the initial voltage across the inductor : Put a 10 V battery with a 10 ? internal resistance in series with a switch: hook this up to a 100 ? resistor in parallel with a 2 H inductor. Find the initial voltage across the inductor when the switch is opened
How much pressure is exerted on the persons head : A 6 foot person stands at the bottom of a 10ft pool filled with water. How much pressure is exerted on the person's head
What is the torque due to the applied force : A wrench is used to tighten a nut. A force of 15 N is applied a distance 8.0 cm from the axis of rotation of the nut; the lever arm is 8.0 cm long

Reviews

Write a Review

JAVA Programming Questions & Answers

  Addressed with attributable risk

Which of the following questions is addressed with attributable risk?

  Write a class that implements an ordered list of strings

In this problem you will write a class that implements an ordered list of Strings.

  Record managing system application

Build a student record managing system application

  Implement a fish-lake simulation

Implement a Fish/Lake simulation similar to the previous assignment. You will then make adjustments to accommodate class hierarchies and make use of inheritance as well as a JAVA interface.

  Java program use breadth-first search closest broadcast

Write the java program which will use breadth-first search (which you implement as part of your program) to determine the closest broadcast vertex for each vertex in graph.

  Define a class called counter

Define a class called Counter. An object of this class is used to count things, so it records a count that is a non negative whole number. Include methods to set the counter to 0, to increase the count by

  Write applet which reads five numbers-draw equivalent stars

Write the applet which reads five numbers (each between 1 and 30). For each number read, your program must design line containing that number of adjacent asterisks.

  Write a recursive boolean method named ismember in java

Write a recursive boolean method named isMember in Java. The method should accept three arguments: an array, a value to search for, and the size of the part of the array being searched.

  Create a deque class based on the discussion of deques

Create a Deque class based on the discussion of deques (double-ended queues) in this chapter. It should include insertLeft(), insertRight(), removeLeft(), removeRight(), isEmpty(), and isFull() methods.

  Define get and set functions and two constructors

Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.

  Java :a user-defined starting position (other than 0,0)

modifying the program so that it can start from a user-defined starting position (other than 0,0) and search for a user defined ending point (other than row-1, column-1) .

  Technical community blog

Write a blog article for a coding and technical community blog.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd