20-CS-694 Advanced Programming Techniques Spring 2012
Applets

Interfaces, Exceptions, Graphics, Animation, Threads, Reflection, Networking, RMI, JDBC, JNI

Previous     Next     All lectures

Introduction

    1.   Prog1.java

    An applet with a BorderLayout. All sections are populated with JButtons.
 
    2.   Prog2.java

    An applet with a GridLayout - two rows, three columns. All sections are populated with JButtons.
 
    3.   Prog3.java

    Use JTextFields, and set properties of widgets. Grid layout showing three JButtons in the top row and three JTextFields in the bottom row
 
    4.   Prog4.java

    Listen to JButton press and take action. Same as the previous applet except ActionListeners are added to the JButtons to detect when a JButton is pressed and some text is displayed in a corresponding JTextField when that happens. This is accomplished by implementing the ActionListener interface required actionPerformed method.
 
    5.   Prog5.java

    Bolt widgets onto panels, panels onto applet. Same as the previous applet except the JButtons are added to a JPanel which is added to the North section of a BorderLayout, the JTextFields are added to a JPanel which is added to the South section, and a JTextArea is added to the Center section. When a JButton is pressed, some text is displayed in a JTextField and also in the JTextArea.
 
    6.   Prog6.java

    Make the panels classes. Same as previous applet except the JPanels are implemented as classes. This makes the applet (class Prog6) readable and compact but requires communication between the JPanel classes. Thus, the constructor for the TopPanel class contains references to the applet and an object of the BotPanel class.
 
    7.   Prog7.java

    The panels are now (floating) frames. Same as the previous applet except the JPanels are implemented as JFrames and are floating apart from the applet. The dimensions of the JFrames can be controlled independently of the dimensions of the applet by using methods setSize and setVisible.