当我尝试使用paint(Graphics g) 代码时出现错误。您能否帮助解决代码,以便有一个带有 3d 矩形的窗口。谢谢!
private static void paint(Graphics g){
g.draw3DRect(10, 10, 50, 50, true);
然后向底部:
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
paint();
}
});
}
}