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

  Hasanodddigit that returns whether any digit

d named hasAnOddDigit that returns whether any digit of a positive integer is odd. Your method should return true if the number has at least one odd digit and false if none of its digits are odd. 0, 2, 4, 6, and 8 are even digits, and 1, 3, 5, 7, 9 a..

  Development of a graphical user interface

To understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  An infix to postfix method for my java program.

an infixToPostFix method for my java program. The method must work with stacks and it should take a string as parameter. The method should be able to convert to postfix mathematic expressions such as: (12 + 4) - 23(9-6)/12. Treat the parenthesis as l..

  Write java program to compute how much federal need to pay

Write a java application to calculate how much federal and state tax you need to pay. The program should accomplish the following task.

  Write an application class that contains several methods

Write a driver class. This class should use the main method to call four methods in the application class that will display our JOptionPanes - Write an application class that contains several methods.

  Punished for minor infractions given their mental illness

What if you a Disciplinary Hearing Officer in a unit with mentally ill inmates? How would you sanction offenders for infractions without punishing them for their illnesses? Do you think they should be punished for minor infractions given their mental..

  Write servlet code for accepting two numbers from user

Write the servlet code for accepting two numbers from user show addition and multiplication of numbers. If error occurs, then call JSP error page to display suitable error message.

  Java problem - g queue

A queue is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle.

  Create a driver class in java

Your project is to create a driver class that uses SuperJavaIceCreamClass.

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

  Write following java expressions in mathematical notation

Write the following Java expressions in mathematical notation.

  Create application uses two-dimensional arrays

Create an application which uses 2-dimensional arrays to keep track of 5 students' grades, with each student having 3 different classes.

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