Take a look at the following method in the MyPanel class you created
```java
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawString("This is a panel",10,20);
g.fillOval(10,40,100,100);
}
```
You'll notice that created a method called paintComponent, with a parameter g of type Graphics. g is known as a Graphics context. It is your "handle" to the screen. It is good practice to handle all graphics through the paintComponent method, using g. Never try to use g elsewhere!
Here are some methods that Graphics g provides. You can always Google some more. Experiment!
```java
g.setColor();
g.drawLine();
g.setFont();
g.draw3DRect();
```
Here is an example of the use of some Graphics methods to draw the following:
![[jpanel example.png|300]]
```java
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.setFont(new Font("Times New Roman",Font.PLAIN,30));
g.drawString("This is a panel",30,20);
g.setColor(Color.BLUE);
g.fillOval(10,40,100,100);
g.setColor(Color.YELLOW);
g.fillRect(10,70,100,30);
}
```