Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

/** * q2: Write a public class named InquiryMouseListener that implements the MouseListener * interface. This class will have a public constructor that takes a

/** * q2: Write a public class named InquiryMouseListener that implements the MouseListener * interface. This class will have a public constructor that takes a JComponent as a * parameter and stores it in an instance variable. Implement the appropriate MouseListener * methods such that the foreground color of the stored JComponent will change to * Color.LIGHT_GRAY when the mouse enters the component, Color.CYAN when the mouse exits the * component, and Color.YELLOW when the component is clicked. After the component has been * clicked is should remain with a foreground of Color.YELLOW regardless of any mouse actions * in the future (Hint: You can do this with a boolean instance variable that tracks whether * of not the component has been clicked). * * Then write a public method in the Problem Set class named mouseComponents_246 that takes * no parameters and returns a new JPanel containing a new JComboBox, and a JButton each with * a different instance of InquiryMouseListener added to it with itself as the JComponent for * the listener. That is, when calling the constructor for InquiryMouseListener the input * should be the component to which the instance will be added. * * You can/should add this JPanel to a JFrame in your main method to verify the proper * functionality */

PLEASE HELP ME, GIVE ME A RIGHT ANSWER, THANK YOU !!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

8-6 Who poses the biggest security threat: insiders or outsiders?

Answered: 1 week ago