Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here\'s the problem Windows on the desktop are just one of many objects used in

ID: 3534737 • Letter: H

Question

Here's the problem

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 -- 2 overloaded methods : both boolean -returning; one accepts a pair of integer parameters ; the second a single parameter of type Position - resize-- 2 overloaded methods ; both boolean -returning; one accepts a pair of integer parameters ; the second a single parameter of type Dimension



interface GUIComponent

{

void onClick(int a);

void onCursorFocus();

boolean move(int a, int b);

boolean move(Position p);

boolean resize(int x, int y);

boolean resize(Dimension d);

}

Explanation / Answer

An interface is not something you can Run....

You need to implement an interface and then you can use it...


Class MyClass Implements GUIComponent

{

void onClick(int a)

{

//Define Method Here

}

void onCursorFocus()

{

//Define Method Here

}

boolean move(int a, int b)

{

//Define Method Here

}

boolean move(Position p)

{

//Define Method Here

}

boolean resize(int x, int y)

{

//Define Method Here

}

boolean resize(Dimension d)

{

//Define Method Here

}

}