1 / 18

Java Advanced Programming

Java Advanced Programming. Introduction to GUI in Java. Explain the term object-oriented programming Explain the concepts of classes, objects, properties, methods and events List and describe the three steps for writing a Java projects Identify the elements of the NetBeans environment

zaza
Download Presentation

Java Advanced Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JavaAdvanced Programming

  2. Introduction to GUI in Java • Explain the term object-oriented programming • Explain the concepts of classes, objects, properties, methods and events • List and describe the three steps for writing a Java projects • Identify the elements of the NetBeans environment • Define design time, run time and break time • Write, run, save, modify your first Java project • Identify syntax errors, run-time errors and logic errors

  3. The Windows GUI • Microsoft Windows uses GUI • Windows GUI defines how the various elements look and function • Create new windows, called forms. • Use the toolbox to add the various elements called controls. • Projects written follow a programming technique called OOP.

  4. Programming Languages- Procedural, Event Driven, & Object Oriented • Procedural languages – the program specifies the exact sequence of all operations -program logic determines the next instruction to execute in response to conditions & user request e.g. BASIC, C, COBOL, FORTRAN, PL/I & Pascal • OOP languages – program are no longer procedural - do not follow a sequential logic - user can press keys & click various buttons & boxes in a window e.g. VB.NET, C# & Java

  5. The Object Model • Will work with objects which have properties, methods and events • Each object is based on a class • Objects • Properties • Methods • Events • Classes

  6. The Object Model (cont.) • Objects e.g. forms – windows and dialog boxes you place on the screen controls – components you place inside a form, such as text boxes, buttons and list boxes • Properties – tell something about or control the behavior of an object such as its name, color, size or location

  7. The Object Model (cont.) • Methods • Actions associated with objects are called methods. • Methods are the verbs of object-oriented programming. • Events • An event occurs when the user takes an action such as clicking a button, pressing a key or closing a window • Events also can be triggered by actions of other objects

  8. The Object Model (cont.) • Classes • A class is a template or blueprint used to create a new object. • Classes contain the definition of all available properties, methods and events. • Each time you create a new object it must be based on a class.

  9. Writing Java Projects • 3 steps for planning the project • Repeat the process for creating the project • Setting up the user interface • Defining the properties • Creating the code

  10. The NetBeans Environment • IDE- Integrated Development Environment - consists of various tools, including the ff: • Form designer • Editor • Compiler • Debugger • Object browser • Help facility

  11. IDE Start Page

  12. New Project Dialog

  13. IDE Main Window

  14. Document window – largest window in the center of the screen • Form designer – where you design a form that makes up your user interface • Properties window – set the properties for the objects in your project • Toolbox – holds the tools you use to place controls on a form • Help – includes the entire reference manual as well as many coding examples

  15. While you are designing the user interface and writing code, you are in design time. • When you are testing and running your project you are in run time. • If you get a run-time error or pause project execution, you are in break time.

  16. Writing your first Java Project

  17. Recommended Naming Conventions

  18. Finding & Fixing Errors • Syntax errors • When you break a rules for punctuation, format or spelling you generate syntax error. • Run-time errors • If your project halts during execution, it is called a run-time error or an exception. • Statements that cannot execute correctly cause run-time errors. • Logic errors • Your project runs but produces incorrect results

More Related