Java Code Samples

Automotive GUI - The following graphical user interface application demonstrates the following: Imported classes such as javafx and the application class, Inheritance-- the Automotive class inherits from the Application class, Instance fields/methods, Overloaded addToTotal methods, with a running total instance field Automotive.java Top .

Overridden start method that specifies that it can throw an exception, Various JavaFX controls such as buttons, text fields, check boxes, etc.

Exception handling, mutliple if statements, and the Decimal format class (which formats the numbers into the format of ##.##)

Application output


Employee class

Employee class

ProductionWorker class

ProductionWorker class

TeamLeader class, uses the this. reference variable inside the getters and setters

TeamLeader class

The TeamLeader class's toString method overrides the Employee class's toString method,

Launcher,in the output below it shows polymorphism via the output of the TeamLeader class's toString method rather than the Employee class's, even though the object is instantiated as an employee

Program output

Password validator application

This class utilizes various conditional statements such as for, if, if else. Along with a Char array and an equals method call that compares two different strings and returns true if they are indeed equal, false if not

Payroll class and SearchArray class

These classes demonstrate do while statements and various arrays

Sequential search method inside the SearchArray class


Elements

Text

This is bold and this is strong. This is italic and this is emphasized. This is superscript text and this is subscript text. This is underlined and this is code: for (;;) { ... }. Finally, this is a link.


Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6

Heading with a Subtitle

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

Heading with a Subtitle

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

Heading with a Subtitle

Lorem ipsum dolor sit amet nullam id egestas urna aliquam

Nunc lacinia ante nunc ac lobortis. Interdum adipiscing gravida odio porttitor sem non mi integer non faucibus ornare mi ut ante amet placerat aliquet. Volutpat eu sed ante lacinia sapien lorem accumsan varius montes viverra nibh in adipiscing blandit tempus accumsan.

Lists

Unordered

  • Dolor pulvinar etiam magna etiam.
  • Sagittis adipiscing lorem eleifend.
  • Felis enim feugiat dolore viverra.

Alternate

  • Dolor pulvinar etiam magna etiam.
  • Sagittis adipiscing lorem eleifend.
  • Felis enim feugiat dolore viverra.

Ordered

  1. Dolor pulvinar etiam magna etiam.
  2. Etiam vel felis at lorem sed viverra.
  3. Felis enim feugiat dolore viverra.
  4. Dolor pulvinar etiam magna etiam.
  5. Etiam vel felis at lorem sed viverra.
  6. Felis enim feugiat dolore viverra.

Icons

Definition

Item 1

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

Item 2

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

Item 3

Lorem ipsum dolor vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent.

Actions

Blockquote

Fringilla nisl. Donec accumsan interdum nisi, quis tincidunt felis sagittis eget tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan faucibus. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis.

Table

Default

Name Description Price
Item 1 Ante turpis integer aliquet porttitor. 29.99
Item 2 Vis ac commodo adipiscing arcu aliquet. 19.99
Item 3 Morbi faucibus arcu accumsan lorem. 29.99
Item 4 Vitae integer tempus condimentum. 19.99
Item 5 Ante turpis integer aliquet porttitor. 29.99
100.00

Alternate

Name Description Price
Item 1 Ante turpis integer aliquet porttitor. 29.99
Item 2 Vis ac commodo adipiscing arcu aliquet. 19.99
Item 3 Morbi faucibus arcu accumsan lorem. 29.99
Item 4 Vitae integer tempus condimentum. 19.99
Item 5 Ante turpis integer aliquet porttitor. 29.99
100.00

Buttons

  • Special
  • Default
  • Alternate

Form


Image

Fit

Left & Right

Lorem ipsum dolor sit accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Vestibulum ante ipsum primis in faucibus magna blandit adipiscing eu felis iaculis volutpat lorem ipsum dolor sit amet dolor consequat.

Lorem ipsum dolor sit accumsan interdum nisi, quis tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Vestibulum ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent. Vestibulum ante ipsum primis in faucibus magna blandit adipiscing eu felis iaculis volutpat lorem ipsum dolor sit amet dolor consequat.

Box

Felis sagittis eget tempus primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus. Integer ac pellentesque praesent tincidunt felis sagittis eget. tempus euismod. Magna sed etiam ante ipsum primis in faucibus vestibulum. Blandit adipiscing eu ipsum primis in faucibus vestibulum. Blandit adipiscing eu felis iaculis volutpat ac adipiscing accumsan eu faucibus lorem ipsum dolor sit amet nullam.

Preformatted

i = 0;

while (!deck.isInOrder()) {
    print 'Iteration ' + i;
    deck.shuffle();
    i++;
}

print 'It took ' + i + ' iterations to sort the deck.';