Java JFrame draw
问题 I'm currently working with JFrame and I'm trying to draw a rectangle but I don't know how to execute the code paint(Graphics g) , how do I get the Graphics object? package com.raggaer.frame; import java.awt.Dimension; import java.awt.Graphics; import javax.swing.JFrame; public class Frame { private JFrame frame; public Frame() { this.frame = new JFrame("Java Snake"); this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.frame.setSize(new Dimension(500, 500)); // DRAW?? this.frame