public String[] imagesArray = {Images.firstImage, Images.secondImage};
String imagesPath = "/testproject/images/";
for(int i = 0; i<imagesArray.length; i++) {
URL imageURL = this.getClass().getResource(imagesPath+imagesArray[i]);
ImageIcon orignalImageIcon = new ImageIcon(imageURL);
Image newImage = orignalImageIcon.getImage().getScaledInstance(100, 90, java.awt.Image.SCALE_SMOOTH);
ImageIcon newImageIcon = new ImageIcon(newImage);
JButton receiptButton = new JButton(newImageIcon);
receiptButton.setBorder((new EmptyBorder(0,0,0,0)));
toolBar.add(receiptButton);
add(toolBar);
}
图片未显示在我的设计布局中?