Reference no: EM13322769
writing a program in JAVA that identifies the color underneath the mouse pointer and fills a JFrame with that color, and displays the RGB values of that color. This is what I have so far:
import java.awt.Component;
import java.awt.event.*;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.PointerInfo;
import java.awt.Robot;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class FinalProject {
public static void main(String[] args) throws AWTException {
// sets up application window
JFrame frame = new JFrame("Color Blind Assistant");
frame.setVisible(true);
frame.setSize(500,500);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// determines color underneath mouse
PointerInfo cursorLocation = MouseInfo.getPointerInfo();
Point position = cursorLocation.getLocation();
int x = (int)position.getX();
int y = (int)position.getY();
Robot colorfind = new Robot();
Color pixelColor = colorfind.getPixelColor(x, y);
int colorRed = pixelColor.getRed();
int colorGreen = pixelColor.getGreen();
int colorBlue = pixelColor.getBlue();
// sets color of application background
frame.getContentPane().setBackground(pixelColor);
// prints RGB value of color under mouse
What is her height above the river at her lowest point
: Your adventurous friend Lola goes bungee jumping. She leaps from a bridge that is 100 m above a river. WHat is her height above the river at her lowest point
|
Construct e-r diagram for a car insurance company
: Construct E-R diagram for a car insurance company whose customers own one car or more cars each. Each car with it zero to any number of recorded accidents.
|
Write program using array that asks user to input 10 numbers
: Write a program using array that asks user to input 10 numbers, then calculates the average of those numbers and finds out the total number that is greater or equal to the average.
|
Explain the orbitals is the same in a multielectron atom
: The arrangement of the orbitals is the same in a multielectron atom and a single-electron atom. In the Li atom, the 3s, 3p, and 3d orbitals have different energies. The He atom has one electron each in 1s and 2s orbitals.
|
Program in java that identifies the color underneath
: writing a program in JAVA that identifies the color underneath the mouse pointer and fills a JFrame with that color, and displays the RGB values of that color.
|
Declare a 1-dimensional array of integers
: In pseudocode and in C code, declare a 1-dimensional array of Integers called InternetHits that will hold up to 10 Integer values representing the number of hits a Web site receives.
|
Explain aqueous solution containing sodium iodide
: Iodine is prepared both in the laboratory and commercially by adding Cl2(g) to an aqueous solution containing sodium iodide: 2NaI(aq) +Cl2(g) arrow I2(s) +2NaCl(aq) How grams of iodide, NaI, must be used to produce 55.6 g of iodine, I2
|
Find counter examples to each of these statements
: if a = b(mod m) and c=d(mod m); a,b,c,d,m are integers; c,d>0 and m=> 2, then a^c = b^d(mod m)[note: every = should be triple equal]
|
Write a code using greedy best first search
: Write a code using Greedy Best First Search and A* in Java language to find the shortest path in Romania path to Bucharest
|