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: 50% (4 reviews)
The data from Special Topic 201 discusses the technique of combining the main method and JFrame into ...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...
-
Boulder Wilderness Adventures purchased rafting and kayaking equipment by issuing a note to Recreational Co-op, the seller of the equipment. The note required a down payment of $5,000, annual...
-
Why do we generally prefer a probabilistic model to a deterministic LO9 model? Give examples for which the two types of models might be appropriate.
-
Mons Weatherby owns a sports brokerage agency and sells tickets to major league baseball, football, and basketball games. He also sells sports travel packages that include game tickets, airline...
-
Answer the following 3 questions: 1. What is the industry Outlook on Supply Chain (SC) Logistics? 2. What career would fit your interest in the SC industry? Explain why it's a fit? 3. What is the...
-
1. Using the Malin's Makeovers QuickBooks data file (Malin.qbw or Malin), record entries for the source documents for February. If you have completed the source documents using this company in 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...
-
Perry Corporation is a local grocery store organized seven years ago as a corporation. At that time, 10,000 common shares were issued to the three organizers. The store is in an excellent location,...
-
Research the control system used by your corporation and select pieces of evidence of informational and behavioral control. Be aware that the evidence must respond to the full definition of each type...
-
What strategies can organizations employ to effectively manage workforce diversity and foster inclusion to leverage the full potential of their human capital in a globalized marketplace ?
-
You are given an array of integers representing the prices of a stock on different days. Write a function in JavaScript to calculate the maximum profit that can be obtained by buying and selling the...
-
The following selected information is available for the payroll computations of a company for the month of November 2021: Name of the Employee Gross Payroll for the month Elvira Robles Gloria...
-
Enter the code (from the Code tab) into your compiler. Compile your code and run it. Answer the following critical thinking questions. Save your answers in a Word document. What happens if you enter...
-
Draw a diagram showing the phases and turning points of a business cycle. Using the diagram, illustrate the concepts of recurrence and persistence.
-
Classify each of the following activities as proper or prohibited under the various consumer statutes you have studied. a. Calling a hospital room to talk to a debtor who is a patient there. b....
-
How do you create a one-to-many relationship in a database system?
-
What is an E-R diagram?
-
What is database design?
-
When credit terms for a sale are 2/15, n/40, the customer saves by paying early. What percent (rounded) would this savings amount to on an annual basis
-
An industrial robot that is depreciated by the MACRS method has B = $60,000 and a 5-year depreciable life. If the depreciation charge in year 3 is $8,640, the salvage value that was used in the...
-
What determines a firm's beta? Should firm management make changes to its beta? Be sure to consider the implications for the firm's investors using CAPM.
Study smarter with the SolutionInn App