Escolar Documentos
Profissional Documentos
Cultura Documentos
Developer Needs
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
234321 Java by Example 4
JBuilders Hands-on
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.
Collections in Eliza
10
Java IO
Character Streams - Reader
11
Java IO
Character Streams - Writer
PrintWriter
12
Java IO
Byte Streams - Input
13
Java IO
Byte Streams - Output
14
Java IO in Eliza
15
Java UI - swings
16
Swing (continued)
17
Swing (continued)
18
Swing (continued)
19
Swing (continued)
20
Swing (continued)
21
Event Listener
Some Events and Their Associated Event Listeners Act that Results in the Event Listener Type User clicks a button, presses Enter while typing ActionListener in a text field, or chooses a menu item User closes a frame (main window)
WindowListener
User presses a mouse button while the cursor is MouseListener over a component User moves the mouse over a component Component becomes visible Component gets the keyboard focus Table or list selection changes Any property in a component changes such as the text on a label
234321 Java by Example
MouseMotionListener ComponentListener FocusListener ListSelectionListener PropertyChangeListener
22
Swing architecture is rooted in the model-viewcontroller 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
234321 Java by Example 23
UI in Eliza
JPanel JLabel JTextArea JScrollPane
JTextField
24
25
26
27
MVC in Eliza
ElizaUI
28
Questions
29
Questions (continued)
30
Links
Java tutorial
http://java.sun.com/docs/books/tutorial/
31
32