Chan Ag wrote:I need help in understanding the following.
JComponent, Canvas, Dimension, repaint() method, and Toolkit for now.
JComponent is the abstract superclass of all Swing components (not top level windows). It doesn't actually contain any abstract methods, so you can create a Jcomponent with
new JComponent() {};
Canvas is a legacy AWT class. Use JPanel instead.
Dimension simply encapsulates two int values
height and
width. (Point also encapsulates two int values
x and
y and I guess the only justification for the two separate classes is to enhance code readability. Point represents a location, Dimension represents a size.
repaint() method is to be called whenever a state change requires a visual update. There are too many possibilities to list them all, but two examples could be when the text of a JLabel is set or when a value in a JTable cell is changed or a row is added or removed.
Toolkit is well described in the API. If there's anything there that you don't understand, ask about it specifically.