import java.awt.*;
class DrawingPanel extends Panel {
public void paint(Graphics g) {
//绘制矩形
g.drawRect(50,50,70,70);
//绘制圆角矩形
g.drawRoundRect(110,10,50,30,20,10);
}
}
这里Graphics 的对象在哪里生成?
求助
class DrawingPanel extends Panel {
public void paint(Graphics g) {
//绘制矩形
g.drawRect(50,50,70,70);
//绘制圆角矩形
g.drawRoundRect(110,10,50,30,20,10);
}
}
这里Graphics 的对象在哪里生成?
求助
我只说抽象类不能new,要实现汗...
public void paint(Graphics g) {
if (isShowing()) {
if (printing) {
synchronized (this) {
if (printing) {
if (printingThreads.contains(Thread.currentThread())) {
return;
}
}
}
}}
能否指点一下,请指教
public void paint(Graphics g) {
if (isShowing()) {
if (printing) {
synchronized (this) {
if (printing) {
if (printingThreads.contains(Thread.currentThread())) {
return;
}
}
}
} // The container is showing on screen and
// this paint() is not called from print().
// Paint self and forward the paint to lightweight subcomponents. // super.paint(); -- Don't bother, since it's a NOP. GraphicsCallback.PaintCallback.getInstance().
runComponents(component, g, GraphicsCallback.LIGHTWEIGHTS);
}
}
没有JVM,怎么创建对象和传递
并没有哪个程序去实现,因为这需要本地代码来实现
这也是一个好处,JVM可以帮我们隐藏实现细节,我们直接用就可以了