Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The first image is my current code for my task. The second image is the way I am calling it. My task is 1) Create

image text in transcribedimage text in transcribed

The first image is my current code for my task. The second image is the way I am calling it.

My task is

1) Create a class named FramedPanel that extends JPanel. The class should have one private member variable named color (of type Color).

2) There should be a single constructor that takes a Color parameter and sets the variable color to equal the parameter.

3) You should override the paintComponent method inherited from JPanel.

4) The overridden paintComponent method should outline the panel in a border that is the same color as the private variable color. The thickness of the border should be whichever is less: 1/20 of the width of the panel or 1/20 of the height of the panel.

5) The central area of the panel should be white. There should be a thin black line dividing the border from the white center.

6) Modify your PlainPanel code from the previous assignment (6.1) to place a red FramedPanel in the CENTER position of the PlainPanel. (You should only need to add one line of code to the PlainPanel file, and is demonstrated at the beginning of the video link above)

7)Use the PlainPanelMain file from the previous assignment (or create your own runner class) to see what the panel looks like.

ALL CODE ARE IN JAVA.

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago