Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Windows on the desktop are just one of many objects used in a graphical user interface (GUI)-- buttons, drop-down list boxes, pop-up menus, are just

Windows on the desktop are just one of many objects used in a graphical user interface (GUI)-- buttons, drop-down list boxes, pop-up menus, are just some of the many others. Regardless of their particular appearance, tasks, and structure, all such GUI components share some common functionality-- which is handled in a manner unique to the actual component .

Define an interface, GUIComponent, with the following methods :

onClick-- void-returning and accepts a single integer parameter

onCursorFocus -- void-returning and accept no parameters

move -- 3 overloaded methods : both boolean -returning; one accepts a pair of integer parameters ; the second a singleparameter of type Position; the third a single parameter of type Dimension

resize-- 2 overloaded methods ; both boolean -returning; one accepts a pair of integer parameters ; the second a singleparameter of type Dimension

My Code:

interface GUIComponent{  public void onClick(int x);  public void onCursorFocus();  public void onCursorFocus(int number1);  public abstract boolean move(int number1, int number2);  public abstract boolean move(Position position);  public abstract boolean move(Dimension dimension);  public abstract boolean resize(int number1, int number2);  public abstract boolean resize(Dimension dimension); } 

Errors:

We did not expect but found: in class GUIComponent: a public abstract method named resize returning a boolean and accepting a parameter of type Dimension. a public abstract method named onCursorFocus returning void and accepting no parameters.

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions