StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Boxes and Tubes Application - Coursework Example

Cite this document
Summary
This coursework "Boxes and Tubes Application" discusses application that has been designed in close adherence to the system requirements indicated in the questionnaire. It has also been designed in such a manner as to enhance customer experience…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER95.7% of users find it useful
Boxes and Tubes Application
Read Text Preview

Extract of sample "Boxes and Tubes Application"

  1. User interface.
    • The main form

The main form is the form that is displayed when the application is launched. It has three buttons namely MENU ITEM, ORDER MENU & EXIT.

On clicking MENU ITEM, the available items are displayed on a different form. This only offers a description of these items and how to place an order. From this form, you can either go back to the main menu or exit the system.

The ORDER MENU button launches the Ordering System Form. This is the main form in which the user states their requirements and the system compiles the items ordered and computes the price.

  1. CODE EXPLANATION.

CLASS PROJECT.JAVA

This is the main class of the project. The package keyword appears at the beginning of every class declaration. This is used to make the class reusable in other classes thus enhancing importing one class to another.

The import declaration helps the compiler to locate classes used in the program. These are actually predefined packages that save the programmer the pain of having to ‘re-invent the wheel’.

public class Project extends JFrame implements ActionListener declares a class which is we are going to construct our GUI. The extended keyword indicates that the class is a child of class JFrame and represents an inheritance relationship. Implements keyword is essential while using an interface for it indicates that all the methods used in the interface must be declared with the signature declared in the interface declaration in this case ActionListener. The ActionListener implements event handling.

We, therefore, go ahead and declare all the components of the form. Note that the programmer must be able to pre-visualize the desired form before putting down the code for creating it. Also, it is worth noting that for the neatness all the controls are placed within panels named Jpanel.

Public static void main (String [] args) is the start point of every Java application of which every application must have one and only one method named main without which the application will not execute. The void keyword indicates that the application will not return any information.

public Project() is the function that actually creates the GUI.

public void actionPerformed(ActionEvent e){ is put into action when the user does any of the actions declared within this function.

Finally, we declare the function for carrying out the calculation.

public double calculates (double grade). The variables and constants here can be changed to bring about the desired outcome such as factoring in tax, discounts, and the like.

CLASS BOXESTUBES.JAVA

This class is much similar to the project.java class above. It is used to create the start-up form. The procedure is the same in all aspects except for the minor specialties of the form.

CLASS ORDERMENU.JAVA

This class carries the code for creating the order menu form called frames in java. As in all the other classes, we start by packaging our class followed by importing the desired in-built classes.

class order menu extends JFrame implements ActionListener declares a class that inherits from JFrame and implements ActionListener which detects user action such as clicking typing, pressing enter or any such action that the programmer my desire to capture. As in the other two classes, we declare the controls we intend to place in the form such as JButton, JRadioButton, JTextField, JCheckBox, JComboBox, and the JTextArea followed by variable declaration.

public static void main(String[] args){ method constructs  the required frame (form). The frame. pack()function causes the window to be resized to fit the preferred size by automatically adjusting its height and width.

The other parameters of the window are self-explanatory.

public order menu(){ function is the window constructor.

It is in this function that we now place all the controls that we had declared earlier in the desired position. As previously stated we place the controls within panels for better organization. Also, note that since a panel is a container we can have a panel within another panel. While adding controls into a panel, we use the add() function. Ideally, every control should be labeled for the purpose of clarity.

The North, south, west,  east keywords are used to set the position of the panel within the window.

The try{ } block encloses code that might throw an exception and the code within that block should not execute should the exception occur. Should the exception occur, the catch block handles the exception. This is important especially when we expect the user to make a mistake when entering the details of the container

The code in most cases is self-explanatory and where there seem to be complications, I have tried my best to make it clear and easy to understand. Also note that in this explanation I have not included the following classes; circular.java, open.java, rectangular.java, circular.java. This is because I had created the classes in the initial stage of application design which later changed and never implemented at all. You can actually comment on all these classes and the application will run just fine.

 Please feel free to ask for further clarification should the need arise.



Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Java Coursework Example | Topics and Well Written Essays - 1000 words”, n.d.)
Java Coursework Example | Topics and Well Written Essays - 1000 words. Retrieved from https://studentshare.org/information-technology/1593659-java
(Java Coursework Example | Topics and Well Written Essays - 1000 Words)
Java Coursework Example | Topics and Well Written Essays - 1000 Words. https://studentshare.org/information-technology/1593659-java.
“Java Coursework Example | Topics and Well Written Essays - 1000 Words”, n.d. https://studentshare.org/information-technology/1593659-java.
  • Cited: 0 times

CHECK THESE SAMPLES OF Boxes and Tubes Application

Software Development (JAVA) of Class Diagram

The class diagram shows the classes employed in the java application.... The instance diagram depicts the flow of the object-oriented program and traces the entire execution path or process flow of the application.... the Operator who initializes the stock of grade 1, grade 2, grade 3 of boards present in the company's reserves for designing tubes and boxes....
2 Pages (500 words) Coursework

A Survey of Nurses: Medication Administration Via Enteral Tubes

Though best practices can easily be identified from options, by application of 'evidence-based practice, nurses still apply alternative approaches in administering medication to patients.... It means the application of the most appropriate approaches to solving precisely identified problems.... This essay "A Survey of Nurses: Medication Administration Via Enteral tubes" is about the benefits of evidence-based practice in the scope of the nursing profession and then reviews the research article....
10 Pages (2500 words) Essay

Space Elevator

Research has shown that Carbon nano tubes have the capacity to withstand tensile strength of 63 to 177 GPa and are pretty light, as because of the chemical structure of the carbon atoms ensure that there is free space in between the carbon atoms.... Thorough research is necessary to produce carbon nano tubes which are stronger....
3 Pages (750 words) Research Proposal

Packaging Design Issues

Types of lighting application There are many types of lighting applications these include; Incandescent bulbs Fluorescent lights Compact fluorescent lights (CFL)Metal halide bulbs Light emitting diodes (LED)Special lights (infra-red lights and X ray lights )Lighting accessories such as sockets, switches and lamp bases There are various packaging materials for these different lighting....
11 Pages (2750 words) Essay

Acoustic Emission Refers to the Waves of the Ultrasound and Sound

The paper "Acoustic Emission Refers to the Waves of the Ultrasound and Sound" states that the differences in the steps of fracture in different substances ought to be studied via laboratory experiments.... Stiffer substances can produce larger emissions rendering the detection of damages in bones....
7 Pages (1750 words) Essay

Materials and Apparatuses for Biuret Test

In the course of the experiment, the presence of a peptide bond through the application of the method would result in a copper (ii) ion forming violet colour in an alkaline solution.... The paper "Materials and Apparatuses for Biuret Test" tells that the experiment was conducted to determine the protein level in different sets of solutions....
5 Pages (1250 words) Lab Report

Different Aspects Relating to the Bicycle Frame

The paper entitled 'Different Aspects Relating to the Bicycle Frame' presents the production of the bicycle which has undergone a significant revolution through decades since its invention.... People have involved technologies of varying standards to ensure.... ... ... ... The bicycle frame is the main part that determines the value of the complete machine....
9 Pages (2250 words) Case Study

Characterization of Auto-Antigens as Biomarkers in Kidney Cancer

After completing this process 1ml of media is added and 2ml cells are removed from the tubes.... This work called "Characterization of Auto-Antigens as Biomarkers in Kidney Cancer" describes the experiment was held to recognize the characteristics of TROVE2 protein along with mRNA expression in kidney cells to utilize as a kidney cancer biomarker....
19 Pages (4750 words) Lab Report
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us