User Tools

Site Tools


project:week12

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

project/week12.txt · Last modified: 2010/05/11 14:48 by jtk