Is it a requirement to use inheritance for frames, as described in Section 20.1.3? (Consider Special Topic
Question:
Is it a requirement to use inheritance for frames, as described in Section 20.1.3?
(Consider Special Topic 20.1.)
Data from special topic 20.1
Transcribed Image Text:
Special Topic 20.1 Adding the main Method to the Frame Class Have another look at the FilledFrame and Filled FrameViewer2 classes. Some programmers prefer to combine these two classes, by adding the main method to the frame class: public class Filled Frame extends JFrame { public static void main(String[] args) { } JFrame frame = new Filled Frame(); frame.setTitle("A frame with two components"); frame.setDefaultCloseOperation (JFrame. EXIT_ON_CLOSE); frame.setVisible(true); public FilledFrame() { createComponents(); setSize(FRAME_WIDTH, FRAME_HEIGHT); } } This is a convenient shortcut that you will find in many programs, but it does not separate the responsibilities between the frame class and the program.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
Inheritance is not a requirement f...View the full answer
Answered By
Antony Sang
I am a research and academic writer whose work is outstanding. I always have my customer's interests at heart. Time is an important factor in our day to day life so I am always time conscious. Plagiarism has never been my thing whatsoever. I give best Research Papers, Computer science and IT papers, Lab reports, Law, programming, Term papers, English and literature, History, Math, Accounting, Business Studies, Finance, Economics, Business Management, Chemistry, Biology, Physics, Anthropology, Sociology, Psychology, Nutrition, Creative Writing, Health Care, Nursing, and Articles.
5.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Java Programming questions
-
As described in Section 5.7, virtual memory uses a page table to track the mapping of virtual addresses to physical addresses. This exercise shows how this table must be updated as addresses are...
-
Consider the following piece of C code: for (j=2;j <1000;j++) D[j] = D[j1]+D[j2]; Th e MIPS code corresponding to the above fragment is: Instructions have the following associated latencies (in...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
The Commerce Department reported that in December 2015, retail sales rose by 0.2, net exports decreased, inventories held by businesses rose by 0.1 percent, and total sales by businesses fell by 0.6...
-
During the isothermal heat addition process of a Carnot cycle, 900 kJ of heat is added to the working fluid from a source at 400C. Determine (a) The entropy change of the working fluid, (b) The...
-
For what is the Java name extension .class used?
-
The cash flows associated with a project are shown below. The interest rate varies from year to year as shown. Determine an equivalent uniform annual series of cash flows. EOY Cash Flow Interest...
-
For the following independent situations, assume that you are the audit partner on the engagement: 1. During your audit of Raceway.com, Inc., you conclude that there is a possibility that inventory...
-
For this assignment, submit the code (SQL script or document), including structure from the Data Definition Language (DDL) and the Data Manipulation Language (DML). Use these SQL Statements as a...
-
Twobucks Coffee Company currently operates 12 coffee shops in downtown Nashville. The company has been losing money and wants to downsize by closing some stores. Its policy has been to saturate the...
-
Why did the program in Section 20.2.2 use a text area and not a label to show how the interest accumulates? How could you have achieved a similar effect with an array of labels? Data from 20.2.2
-
The ColorFrame in Section 20.5 uses a grid layout manager. Explain a drawback of the grid that is apparent from Figure 15. What could you do to overcome this drawback? Figure 15 box Rectangle x = 5 y...
-
Which of the following combinations correctly describes the relationship between foreign currency transactions, exchange rate changes, and foreign exchange gains and losses?
-
Distinguish between statement of affairs and balance sheet.
-
List the various advantages of computerised accounting systems.
-
Describe the various types of accounting software along with their advantages and limitations.
-
Explain how the following may be ascertained from incomplete records: (a) Opening capital and closing capital (b) Credit sales and credit purchases (c) Payments to creditors and collection from...
-
What do you understand by database. How does it differ from DBMS?
-
Develop a BCG Matrix for your university. Because your college does not generate profits, what would be a good surrogate for the pie slice values? How many circles do you have and how large are they?...
-
A superior criticized a sales manager for selling high-revenue, low-profit items instead of lower-revenue but higher-profit items. The sales manager responded, My income is based on commissions that...
-
How do you create a one-to-many relationship in a database system?
-
What is an E-R diagram?
-
What is database design?
-
Austin can choose Plan A or Plan B for his long distance charges. For each plan, cost (in dollars) depends on minutes used (per month) as shown below. 28 Plan A 26 24- 22- Cost 20- (in dollars) 16-...
-
Identify Stephen's and Madeline's current insurance cover. Identify whether each policy's premiums are deductible and whether the proceeds from each of the policies are assessable and at what rate.
-
For a law firm, the wages and salaries of the employees are placed in which budget?
Study smarter with the SolutionInn App