Download presentation
Presentation is loading. Please wait.
1
Lecture 18 More on GUIs and Graphics Selected examples from Chapters 12, 13, 14, 15 Please read details in the book No need to memorize any of these details!!! HW7: please do something interesting and challenging with user interaction… I will weight this assignment more than the others
2
Graphics When the system needs to redisplay a window or window component, it calls paintComponent Therefore, when we draw graphics on a swing component such as JPanel or JLabel or a user- defined subclass of one of these, we must put these statements inside an overriding paintComponent method Our program should not call paintComponent. Only the system calls it. When we want to make changes to a graphical display, we have to tell the system to call the overriding paintComponent. We do this by calling repaint().
3
Demos TestSwingCommonFeatures TestFigurePanel TestMessagePanel DisplayClock –change from a still to a moving clock MoveMessageDemo ClockAnimation ButtonDemo CheckBoxDemo RadioButtonDemo TextFieldDemo TextAreaDemo ComboBoxDemo ScrollBarDemo etc
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.