E-Book, Englisch, 246 Seiten, eBook
Reihe: Essential Series
Cowell Essential Java 2 fast
Erscheinungsjahr 2012
ISBN: 978-1-4471-0573-2
Verlag: Springer
Format: PDF
Kopierschutz: 1 - PDF Watermark
How to develop applications and applets with Java 2
E-Book, Englisch, 246 Seiten, eBook
Reihe: Essential Series
ISBN: 978-1-4471-0573-2
Verlag: Springer
Format: PDF
Kopierschutz: 1 - PDF Watermark
Zielgruppe
Lower undergraduate
Autoren/Hrsg.
Weitere Infos & Material
1 Why Java 2 is Special.- Is this book for you?.- What you need to run Java 2.- How to use this book.- An object-oriented approach.- Conventions.- 2 An Object-Oriented Application.- A first application.- What can go wrong?.- How does the application work?.- Classes and objects.- The main method.- What’s new.- Running the application.- Using classes and objects.- Naming conventions.- 3 The Java Language.- Applications and applets.- Comments.- Terminating Java statements.- Data types.- The integer data types.- The floating point data types.- The boolean data type.- The char data type.- The String data type.- Names in Java.- Declaring data.- Arithmetic in Java.- Mixing data types.- Casting.- Assignment operators.- Using strings in Java.- Operator precedence.- Displaying information on your screen.- 4 Branching and Looping.- The If…else statement.- Logical operators.- The switch statement.- Block statements.- Looping.- The for loop.- The while loop.- The do…while loop.- The break statement.- Arrays.- 5 Creating and Using Classes and Objects.- The Account class.- The displayDetails method.- The inCredit method.- The credit and debit methods.- The main method.- Using constructors.- Encapsulating data.- Calling methods.- Command line arguments for applications.- 6 Using Applets.- Writing applets.- The APPLET tag.- Key methods of the Applet class.- The init method.- The start method.- The stop method.- The destroy method.- The paint method.- Command line arguments for applets.- 7 The Graphics, Color and Font Classes.- The co-ordinate frame.- Importing classes.- The Graphics class.- Drawing lines.- Drawing rectangles.- Drawing circles and ovals.- Drawing arcs.- Drawing polygons.- The Color class.- Creating colours.- Displaying text and changing fonts.- Displaying images.-8 Inheritance and Polymorphism.- A hierarchy of computer components.- Defining the Memory subclass.- Polymorphism.- The MBoard class.- Extending a subclass.- Class and instance variables.- Static methods.- Overloading methods.- Access control.- Interfaces.- 9 Mouse and Keyboard Events.- The MouseEvent class.- The MouseListener interface.- Which button was pressed?.- The MouseAdapter class.- The MouseMotionListener interface.- The KeyEvent class.- The KeyAdapter class.- The KeyListener interface.- 10 The AWT Components.- Event-driven programming.- The AWT classes.- The Button class.- Handling events.- The Label class.- The Scrollbar class.- Handling Scrollbar events.- The Checkbox class.- The List class.- Multiple selection in List objects.- The TextComponent class.- The TextArea class.- Using the TextListener interface.- The TextField class.- The Canvas class.- 11 The Layout Managers.- The FlowLayout class.- The BorderLayout class.- The CardLayout class.- The GridLayout class.- The GridBagLayout class.- 12 Windows, Dialogs and Menus.- The Container class.- The Frame class.- Creating an application which uses a frame.- The WindowListener interface.- Creating an applet which uses a frame.- The MenuBar class.- The Dialog class.- The FileDialog class.- The Panel class.- 13 The Swing Components.- Differences between Swing and AWT components.- The Swing components.- The Swing container classes.- The AbstractButton class.- The Swing and AWT buttons.- Changing the look and feel.- The JButton class.- The JToggleButton, JRadioButton and JCheckBox classes.- Displaying text.- The JLabel class.- The JTextField class.- The JTextArea class.- The JList class.- The JColorChooser class.- The JFileChooser class.- 14 Java Exceptions.- The Exception class.- The try and catch clauses.- Throwing an exception.- Creating new exceptions.- Throwing without catching.- 15 Writing Threaded Applications.- Pre-emptive scheduling.- The Runnable interface.- The Thread class.- Synchronizing threads.- The Thread class.- Creating animation.- The bouncing ball applet.- 16 Files and Streams.- The File class.- The InputStream and OutputStream classes.- The DatalnputStream and DataOutputStream classes.- Using the DataOutputStream class.- Using the DatalnputStream class.- Reading text files.- Reading from the keyboard.- Converting strings to other data types.