Java by Example - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Java by Example

Description:

Java by Example Introducing IDE, Eliza, UI, IO and other creatures Developer Needs Why not use command-line and notepad? integrated development environment ... – PowerPoint PPT presentation

Number of Views:138
Avg rating:3.0/5.0
Slides: 33
Provided by: ron47
Category:
Tags: basics | example | java

less

Transcript and Presenter's Notes

Title: Java by Example


1
Java by Example
  • Introducing IDE, Eliza, UI, IO and other creatures

2
Developer Needs
  • Why not use command-line and notepad?

3
integrated development environment
  • integrated development environment (IDE) is an
    application or set of tools that allows a
    programmer to write, compile, edit, and in some
    cases test and debug within an integrated,
    interactive environment.

4
Borlands JBuilder
  • Availability Free (Foundation version)
  • Functionality integrated editor, debugger,
    compiler, visual designers, wizards,
    refactorings, code formatting, and much more.
  • Supported OS Windows, Linux, Unix and Mac
  • Other Java IDEs Eclipse, IntelliJ

5
JBuilders Hands-on
6
Java toy example - Eliza
  • Who is Eliza?
  • Eliza was born in the early 1960s in MITs
    labs. It is viewed as the first intelligent
    machine. Its creator is Prof. Joseph Weizenbaum.
  • ?????? ???? ????? ??? ????? ?????? ??????? IBM
    ????"? ????? ?? ?????. ????? ??? ?????? ????? ???
    ''????????? ????????? ??? ????? ????? ????????
    ?? ????'' .

7
Whats next?
  • We will browse through a few of Javas basic
    capabilities and demonstrate how we used them in
    the toy example
  • We will focus on the collection framework, In\Out
    processing and User Interfacing (UI).
  • Finally, we will raise a few questions.

8
Java Collection Framework
Interfaces
9
Java Collection Framework
Implementations
10
Collections in Eliza
11
Java IO
  • Character Streams - Reader

12
Java IO
  • Character Streams - Writer

PrintWriter
13
Java IO
  • Byte Streams - Input

14
Java IO
  • Byte Streams - Output

15
Java IO in Eliza
16
Java UI - swings
17
Swing (continued)
18
Swing (continued)
19
Swing (continued)
20
Swing (continued)
21
Swing (continued)
22
Event Listener
23
The MVC pattern
Meet Little SmallTalk in OOP
  • Swing architecture is rooted in the
    model-view-controller design that dates back to
    SmallTalk. MVC architecture calls for a visual
    application to be broken up into three separate
    parts
  • A Model that represents the data
  • for the application.
  • The view that is a visualization of
  • that data
  • The controller that manipulates the view and
    updates the model

24
UI in Eliza
JPanel
JTextArea
JLabel
JScrollPane
JTextField
25
UI in Eliza (code 1/3)
26
UI in Eliza (code 2/3)
27
UI in Eliza (code 3/3)
28
MVC in Eliza
ElizaUI
ltltElizaModelInterfacegtgt
implements
ElizaModel
Where is the controller? Why use an interface?
29
Questions
30
Questions (continued)
31
Links
  • Java tutorial
  • http//java.sun.com/docs/books/tutorial/
  • Swing Trail - http//java.sun.com/docs/books/tutor
    ial/uiswing/index.html
  • Collections Trail - http//java.sun.com/docs/books
    /tutorial/collections/index.html
  • Java 1.5 Tiger - http//java.sun.com/developer/t
    echnicalArticles/Interviews/hamilton_qa.html

32
Eliza sample conversation
  • Hi there
  • Greetings from inside the box.
  • what shall we talk about
  • Does that question interest you?
  • yes
  • Are you sure?
  • yes I am
  • Do you enjoy being ?
  • again yes
  • You seem quite positive.
  • yes
  • Please elaborate
  • I want to know what you would like to hear
  • So what's stop you?
  • you
  • We were discussing you -- not me.
  • damn right
  • Say, do you have any psychological problems?
  • yes
Write a Comment
User Comments (0)
About PowerShow.com