import java.awt.EventQueue;
import java.awt.Image;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import javax.swing.JLabel;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
@SuppressWarnings("serial")
public class ImgDemo extends JFrame {
private JPanel contentPane;
private int idImg = 1;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
ImgDemo frame = new ImgDemo();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
窗体自定义路径显示图片(Java)
最新推荐文章于 2021-02-27 14:47:55 发布