class NewPanel extends JPanel
{
public NewPanel(){}
public void paintComponent(Graphics g)
{
int p_width = 0;
int p_height = 0;
String imgURL= MakeFrame.filepath;//文件路径
System.out.println(imgURL);
ImageIcon icon = new ImageIcon(imgURL);
p_width = icon.getIconWidth();
p_height = icon.getIconHeight();
g.drawImage(icon.getImage(),20,20,p_width,p_height,null);
g.dispose();
}
}
JPanel绘图
最新推荐文章于 2022-09-03 20:42:41 发布