Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
Java Application using Swing and AWT GUI Components
Answered

Requirements

This assignment involves writing a Java application using Swing and AWT GUI components and a Java collections data structure. If using an IDE, you can not use GUI Designer or any similar tool. No external libraries other than the Java SE API and no third-party classes. The submitted program must be runnable without dependencies on any external library.


All code must be your own and not copied from any source or this will mean disqualification from this stage of selection. The code should be briefly commented. (A line for each block of code explaining what it does)

All source code files and an executable jar file for the application to run. Put all of these in zip format to make reviewing it easier. You must check that the code runs prior to submitting the task.

Write a frame-based application that allows the user to store and manipulate a list of objects of type Cuboid Container for which an incomplete java class is provided. Int id: Cuboid id should be a six digit non-negative integer with no leading 0s Int x: x pixel position of top left point of the first face of the cuboid (hardcoded) Int y: y pixel position of top left point of the first face of the cuboid (hardcoded) Int Width / height: Width and height of the cuboid where width = height (each face is a square) Int Length: Length of cuboid in pixels Point[] faceOnePoints; // Points array used to store vertices (points) of first face of the cuboid Point[] faceTwoPoints; // Points array used to store vertices (points) of second face of the cuboid CuboidContainer class contains incomplete methods that you will use to draw a cuboid using the dimensions specified in the attributes.


The drawn cuboid should look like the figure below where I have labelled how each of the attributes relate to it. The incomplete Container Panel and Container Frame java classes provide a starting point for you where the functionality to draw an incomplete cuboid is given.


The layout of the GUI should be such that any buttons should be displayed at the bottom of the frame and user input should be provided using appropriate text fields that should be displayed at top of the frame. Here you may choose to display buttons and text fields in their own panels. The centre of the GUI should contain a panel to display the drawn cuboid. Here you may choose to use and modify the ContainerPanel java class provided. Any other application outputs should be displayed through print statements in the command window.

Deliverables


The application should provide features and corresponding buttons that allow the user to do the following:


a) Add a CuboidContainer object to the list where the user input text fields should be used to specify values for width/height, length, colour and id).


b) Display all the ids of CuboidContainer from the list in the command window.


c) Search for and retrieve a CuboidContainer object specified by its id (using one of the input text fields). Draw the corresponding cuboid on the central panel of the application. The cuboid should be drawn using the dimension and colour attribute values specified in the retrieved CuboidContainer object.


d) Sort the list of CuboidContainer objects in ascending order of their ids and display the contents of the list in the command window. Here you need to specify an appropriate compareTo() method in the CuboidContainer class and explore the use of Collections.sort() to automatically sort the contents of the list. See Java API and an example of using it here: https://www.geeksforgeeks.org/collections-sort-java-examples/ (note the use of generics).


Id attribute values may contain only whole digits, so should not contain any negative digits, leading zeros, or other characters. The ids should be a fixed length of 6 digits when input by the user. You should not allow the list to store objects with duplicate ids. For each action specified above an appropriate message should be displayed in the command window confirming the action, e.g. - “Cuboid ‘126658’ has been added to the list”. An appropriate error message should be displayed for any failed action e.g. - “The Cuboid ‘12786n’ was not added to the list as a valid id was not provided.”


The list for storing the CuboidContainer objects should be implemented using an ArrayList User input exceptions should be captured by the program using exception handling or acceptable error checking. You should aim to make your user interface easy to use with a clear layout that makes appropriate use of spacing between the displayed components. You many have defined more than one Java class for your application. It is normally good practice to save these in their own physical .java files. Your code should contain one class that contains your main() method from where the application executes. This is the entire task, let me know if you are still up for it! We know this may take longer than the previous one but due to constraints of the selection stage we are wanting applicants to do as much as they can.

support
close