GUI

Lecture 1

Problem: How can a graphical user interface be added to Java programs?

  • JFrame allows us to create a window
  • We can add various widgets to a window
    • JButton
    • JTextField
  • Event driven programming
    • Deep down, a loop is constantly checking for changes
    • We can add an ActionListener to a GUI component
    • An action will cause the actionPerformed method to run

Examples

Lecture 2

Problem: How can a GUI be organized?

  • Useful widgets
    • JLabel
    • JRadioButton
    • JCheckBox
    • JTextArea
    • …many more
  • JOptionPane provides very basic I/O
  • Layout
    • FlowLayout
    • BorderLayout
    • GridLayout
    • BoxLayout

Examples

Lab

 
week12.txt · Last modified: 2008/04/17 13:05 by bwittman
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki