27
Copyright Oracle Corporation, 1998. All rights reserved. 1 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Embed Size (px)

Citation preview

Page 1: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.

11

Creating an Application: The AppBuilder for Java IDE

Creating an Application: The AppBuilder for Java IDE

Page 2: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-22

ObjectivesObjectives

After completing this lesson, you should be able to do the following:

• Create new projects and applications in AppBuilder for Java

• Build and execute Java applications

• Modify Java application source code

After completing this lesson, you should be able to do the following:

• Create new projects and applications in AppBuilder for Java

• Build and execute Java applications

• Modify Java application source code

Page 3: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-33

OverviewOverview

This lesson introduces the AppBuilder for Java Integrated Development Environment (IDE)

• Building, debugging, and deploying Java applications, applets, and JavaBeans

• Wizards to help build source code

• User interface designer

• Database connectivity components

This lesson introduces the AppBuilder for Java Integrated Development Environment (IDE)

• Building, debugging, and deploying Java applications, applets, and JavaBeans

• Wizards to help build source code

• User interface designer

• Database connectivity components

Page 4: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-44

The AppBuilder Environment The AppBuilder Environment

1

2

3

4

Page 5: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-55

Creating a New ProjectCreating a New Project

Select File—>New Project from the MenuSelect File—>New Project from the Menu

Page 6: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-66

Specifying Project Details: Step 1

Specifying Project Details: Step 1

Specify project details:

Specify project details:

Page 7: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-77

Specifying Project Details: Step 2

Specifying Project Details: Step 2

Specify optional project details:

Specify optional project details:

Page 8: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-88

Specifying Project Details: Final Step

Specifying Project Details: Final Step

Choose one of the following options:Choose one of the following options:

Page 9: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-99

Creating a New Java ApplicationCreating a New Java Application

Select File—>New from the Menu bar

Double-clickApplicationicon

Select File—>New from the Menu bar

Double-clickApplicationicon

Page 10: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1010

Specifying Application DetailsSpecifying Application Details

Specify details in Application Wizard:

Thenclick OK

Specify details in Application Wizard:

Thenclick OK

Page 11: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1111

Specifying Frame DetailsSpecifying Frame Details

Specify details in Frame Wizard:

Then click OK

Specify details in Frame Wizard:

Then click OK

Page 12: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1212

The Skeleton Java ApplicationThe Skeleton Java Application

Contains application and frame classes, plus HTML fileContains application and frame classes, plus HTML file

Page 13: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1313

Building and Executing the Application

Building and Executing the Application

Select Project—>Make Project to compile .java files into .class files

Select Run—>Run to launch application

• Creates an application object

• Creates a frame object

• The frame object deals with the user interface

Select Project—>Make Project to compile .java files into .class files

Select Run—>Run to launch application

• Creates an application object

• Creates a frame object

• The frame object deals with the user interface

Page 14: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1414

• The top-level class in the application

– Contains the main() method

Select theapplication class

View code inContent Pane

• The top-level class in the application

– Contains the main() method

Select theapplication class

View code inContent Pane

The Application ClassThe Application Class

Page 15: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1515

Finding Methods and AttributesFinding Methods and Attributes

Use the Structure Pane to find methods and attributes in a class

Select item in Structure Pane

Use the Structure Pane to find methods and attributes in a class

Select item in Structure Pane

Page 16: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1616

The Frame ClassThe Frame Class

Defines the appearance and behavior of the user interfaceDefines the appearance and behavior of the user interface

1

2

Page 17: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1717

Adding Palette Components to the Frame

Adding Palette Components to the Frame

1

2

3

Page 18: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1818

Specifying Component Properties

Specifying Component Properties

Select View—>Inspector to view or edit the properties of a componentSelect View—>Inspector to view or edit the properties of a component

1

2

Page 19: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-1919

Using the Help SystemUsing the Help System

Provides help on all development aspects

• Select Help—>Help Topics

Provides help on all development aspects

• Select Help—>Help Topics

1

2

Page 20: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2020

Finding Help TopicsFinding Help Topics

Master Index tab gives access to all topicsMaster Index tab gives access to all topics

1

Page 21: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2121

Debugging Programs with AppBuilder for Java

Debugging Programs with AppBuilder for Java

• AppBuilder for Java provides a sophisticated debugger

• The debugger provides the following capabilities:

– Step over, or trace into, a method

– Set conditional breakpoints

– Examine and modify “watch” variables

• AppBuilder for Java provides a sophisticated debugger

• The debugger provides the following capabilities:

– Step over, or trace into, a method

– Set conditional breakpoints

– Examine and modify “watch” variables

Page 22: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2222

Using the DebuggerUsing the Debugger

Click the Debug icon to debug an appClick the Debug icon to debug an app

1

Page 23: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2323

Stepping Through a ProgramStepping Through a Program

You can step through a program using the buttons on the Debugger toolbar

• Execute the program

• Step over a method call

• Trace into a method call

• Pause execution

• Stop the debugger

You can step through a program using the buttons on the Debugger toolbar

• Execute the program

• Step over a method call

• Trace into a method call

• Pause execution

• Stop the debugger

Page 24: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2424

Setting BreakpointsSetting Breakpoints

To set a breakpoint:

• Select a line of code in the Source pane

• Click with the right mouse button

• Select Toggle Breakpoint from the pop-up menu

To run to the next breakpoint, select the Run button on the Debug toolbar

To set a breakpoint:

• Select a line of code in the Source pane

• Click with the right mouse button

• Select Toggle Breakpoint from the pop-up menu

To run to the next breakpoint, select the Run button on the Debug toolbar

Page 25: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2525

Watching VariablesWatching Variables

• You can examine and modify local variables in the Data pane

• To watch other variables:

– Select a variable in the Source pane

– Click with the right mouse button

– Select Add Watch at Cursor from the pop-up menu

• View the variable in the “Watch” pane

• You can examine and modify local variables in the Data pane

• To watch other variables:

– Select a variable in the Source pane

– Click with the right mouse button

– Select Add Watch at Cursor from the pop-up menu

• View the variable in the “Watch” pane

Page 26: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2626

SummarySummary

• AppBuilder for Java can be used to build, debug, and deploy Java applications, applets, and JavaBeans

• A new application in AppBuilder has three files:

– Application class, contains main()

– Frame class, defines UI

– HTML file

• AppBuilder for Java can be used to build, debug, and deploy Java applications, applets, and JavaBeans

• A new application in AppBuilder has three files:

– Application class, contains main()

– Frame class, defines UI

– HTML file

Page 27: Copyright  Oracle Corporation, 1998. All rights reserved. 1 Creating an Application: The AppBuilder for Java IDE

Copyright Oracle Corporation, 1998. All rights reserved.1-1-2727

Practice 1-1 OverviewPractice 1-1 Overview

• Opening the final solution project, to gain familiarity with the goal of the practice sessions

• Creating a new project in AppBuilder for Java

• Adding a simple application

• Building and running the application

• Opening the final solution project, to gain familiarity with the goal of the practice sessions

• Creating a new project in AppBuilder for Java

• Adding a simple application

• Building and running the application