Lecture Six – A Simple Calculator

Lecture Six ? A Simple Calculator

More about IDEs Review of what you know Taking a detour Event driven programming Program Development Phases Requirement Analysis ? A Simple Calculator Design Phase ? Draw the interface Implementing the Graphic User Interface Ten steps to a GUI Drill 6

1

More about IDEs

We discussed IDEs earlier, and I promised some more instruction on how to use JCreator. Mrs. Dianne Rister, an outstanding computer science teacher at Consolidated High School in College Station, has provided a lesson on how to download and use JCreator, and I have posted it to the Web Site. Use it if you like, it will make programming a lot easier, or as we mentioned earlier, if you have another IDE you would rather use, feel free to do so.

2

What You Know So Far

So far you know

How to enter an run a basic program in java How to import library packages How to use JOptionPane for input and Output How to use primitive types and Strings How to use basic operators How to use if, switch, and the while and for loops How to use arrays

Some things you don't know yet

Graphic User Interfaces The use of methods (although you have seen the main method) Writing and using constructors

We will discuss these things in detail later, but we are going to go ahead and use them in this lesson.

3

Let's Take a Detour

Let's jump ahead and make a GUI (Graphic User Interface) This code is going to use methods and constructors. Don't be concerned about this, we will discuss methods and constructors in detail in a later lesson.

4

Graphic User Interfaces

What are they?

A GUI is the kind of interface that you are used to using on a computer You have a screen with buttons and entry fields. You indicate what you want done, by entering data and clicking on buttons.

Why are they important?

This is the kind of interface that people expect Java and Windows are designed to facilitate graphic user interfaces If you are not programming with GUIs, you are not taking advantage of the capability of Java And besides, GUIs are fun!

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download