1
這裏是我的代碼在jlable如何jlable在java中顯示完整的圖像
FileDialog fd=new FileDialog(this);
fd.show();
picturepath=fd.getDirectory()+fd.getFile();
jLabelPictureAdd.setIcon(new ImageIcon(picturepath));
jLabelPictureAdd.setHorizontalAlignment(jLabelPictureAdd.CENTER);
diplays only part of the image
顯示完整的圖像,但它這麼想的顯示圖像的完整圖像,但部分請有人幫我解決這個問題。謝謝
的[調整畫面,以適應一個JLabel]可能的複製(http://stackoverflow.com/questions/16343098/resize-a-picture-to-fit-a-jlabel) – TimeToCode
尺寸也許對於JLabel來說太大了...所以它要麼調整標籤或圖像的大小。 –