嗨,我想重新調整圖像圖標,我試圖使用getScaled方法,但它不工作,我附加了下面的代碼副本。Java,GridBagLayout
public Example(){
JLabel l = new JLabel(new ImageIcon(getClass().getResource("gui/CheckLib.png")));
Image resize = l.getScaled(200, 180, 18);
l.setIcon(new ImageIcon(resize));
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.SOUTHEAST;
c.weightx = 1;
c.fill = GridBagConstraints.HORIZONTAL;
add(l);
你是什麼意思,它不工作? – hichris123