frame缩小或放大后怎样保存原来的图
import java.awt.*; import java.awt.event.*;
public class Hua extends Frame
{
Panel p;
public Hua()
{
Frame f=new Frame("");
p=new Panel();
f.add(p);
f.setSize(200,200);
f.setVisible(true);
p.addMouseListener(new MouseAdapter()
{
int x,y;
public void mousePressed(MouseEvent e)
{
x=e.getX();
y=e.getY();
}
public void mouseReleased(MouseEvent e)
{
Graphics g=p.getGraphics();
g.setFont(new Font(null,Font.ITALIC,30));
g.drawString(x+","+y,x,y);
g.drawString(e.getX()+","+e.getY(),e.getX(),e.getY());
g.setColor (Color.PINK);
g.drawLine(x,y,e.getX(),e.getY());
}
});
}
public static void main(String[] args)
{
new Hua();
}
}
我只弄出这个来,具体的把缩小或放大保存原来的图的代码怎么弄就不知道了,请帮助