Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Java GUI program to collect from the user a data set of your choice, subject to the requirements below. Task: Create two classes
Create a Java GUI program to collect from the user a data set of your choice, subject to the requirements below.
Task:
Create two classes following the model shown in Chapter 20 (http://www.pateanu.ca/yorku/ITEC2610/ch20/index.html). Do not copy. Assuming your data forms subject is X (though I expect better names), you need to provide the following classes:
- XFormFrame, as a subclass of JFrame, responsible for creating and operating the form
- XFormViewer, your main program responsible for creating the frame and displaying it
Your form must meet the following content requirements:
- All components must be organized into panels
- It must use both BorderLayout and GridLayout
- It must contain at least one of each of the following controls:
- Labels (where needed in conjunction with other controls, and/or as informational text)
- Text fields
- Radio buttons
- Checkboxes
- Combo boxes
- One scrollable text area labelled Results (see point g. below)
- One button labelled Done
- When this button is clicked, the program should generate a string describing the content of the data in the form, and append this text to the Results text area
- E.g., using the form for the pizza example on page 860 of the textbook, your string might look like this:
Pizza Order Size: Small Add-ons: Peperoni, Anchovies, Price: $12
- It must include a menu, with at least one menu item being Exit to be used for ending the program (use System.exit() to achieve this)
In addition, your programs must meet the following style requirements:
- Use standard Javadoc documentation
- Include other comments as needed
- Use standard and significant naming conventions
- Follow coding standards as described in http://www.oracle.com/technetwork/java/codeconventions-150003.pdf but as a minimum:
- Declare variables one to a line, at the beginning of relevant blocks (except loop variables)
- Initialize all variables
- Indent correctly using 4 space indentation
- Align closing braces to opening braces (if you place opening braces on a separate line) or to the beginning of the statement starting the block
- Use constants where appropriate
- One statement per line
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started