How to resize Image/IconImage in JLabel?
问题 Here's my code: String s = "/Applications/Asphalt6.app"; JFileChooser chooser = new JFileChooser(); File file = new File(s); Icon icon = chooser.getIcon(file); // show the icon JLabel ficon = new JLabel(s, icon, SwingConstants.LEFT); Now, the image extracted from the icon is really small. How can I resize it? 回答1: import java.awt.*; import java.awt.image.*; import javax.swing.*; import java.io.*; class BigIcon { public static void main(String[] args) { JFileChooser chooser = new JFileChooser(