第6周作业-图像缩放显示(改)

import javax.swing.*;
import java.awt.*;
import java.net.URL;
import java.awt.image.*; 

public class ShowImgApp extends JFrame {

int XPoint = 100, ypoint = 100;

public void ShowImgApp() {
//Do frame stuff.
}

public void paint(Graphics g) {
URL imgURL = getClass().getResource("11.gif");
ImageIcon icon = new ImageIcon(imgURL);
g.drawImage(icon.getImage(),XPoint,ypoint,this);
}

// main function
public static void main(String[] args) {
ShowImgApp frame = new ShowImgApp();
frame.pack();
frame.setVisible(true);
}

} 
第6周作业-图像缩放显示(改)_第1张图片

你可能感兴趣的:(Java编程,多线程,编程,java,string,class)