Skip to content

Part 2 — GUI with Swing

2 lectures (CM) · 2 lab sessions (TD) · Autonomous project (BE1)

Objectives

By the end of Part 2 you will be able to:

  • Build a Swing GUI with JFrame, JPanel, and layout managers
  • Connect UI events to model objects via ActionListener
  • Override paintComponent() to draw custom graphics
  • Capture mouse clicks and translate them to game coordinates
  • Build a complete two-player game application

Thread: from Voiture UI to Spider Game

  • CM4/TD4VoitureUI: control panel for the Voiture from Part 1
  • CM5/TD5GridPanel: 3×3 interactive drawing component
  • Project BE1 — Spider Game: full two-player game using everything from Parts 1 and 2

Resources

Resource Link
CM4 slides PDF
CM5 slides PDF
TD4 Voiture Control Panel
TD5 Drawing Canvas & Grid
Project BE1 Spider Game