将按钮添加到下方
将图画添加到中心
frame.getContentPane().add(BorderLayout.SOUTH, button);
frame.getContentPane().add(BorderLayout.CENTER, drawPanel);
显示窗口在屏幕的什么位置
frame.setLocation(500, 500);
事件处理过程用frame的repaint(),然后系统会调用panel 的paintComponent()
将按钮添加到下方
将图画添加到中心
frame.getContentPane().add(BorderLayout.SOUTH, button);
frame.getContentPane().add(BorderLayout.CENTER, drawPanel);
显示窗口在屏幕的什么位置
frame.setLocation(500, 500);
事件处理过程用frame的repaint(),然后系统会调用panel 的paintComponent()