title: How to set image size fix on jlabel?
body: <p>Hi I am trying to make  java desktop application  whee I am having a <code>JLabel</code> I am shuffling
  image I want to set image size fit on that <code>JLabel</code> </p>
  
  <p>Here is my code </p>
  
  <pre><code>public class ImageShuffle extends JPanel {
  
      private List&lt;Icon&gt; list = new ArrayList&lt;Icon&gt;();
      private JLabel label = new JLabel();
      private Timer timer = new Timer(1000, new ActionListener() {
  
          @Override
          public void actionPerformed(ActionEvent e) {
              update();
          }
      });
  
      public ImageShuffle() {
          this.setLayout(new GridLayout(1, 0));
            list.add(new ImageIcon("E:\\SOFTWARE\\TrainPIS\\res\\drawable\\e.jpg"));
      list.add(new ImageIcon("E:\\SOFTWARE\\TrainPIS\\res\\drawable\\d.jpg"));
      list.add(new ImageIcon("E:\\SOFTWARE\\TrainPIS\\res\\drawable\\yellow.png"));
        list.add(new ImageIcon("E:\\SOFTWARE\\TrainPIS\\res\\drawable\\f.jpg"));
              list.add(new ImageIcon("E:\\SOFTWARE\\TrainPIS\\res\\drawable\\l.jpg"));
          label.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
  
          timer.start();
      }
  
      private void update() {
          Collections.shuffle(list);
          label.setIcon(list.get(0));
      }
  
      private void display() {
          JFrame f = new JFrame("ImageShuffle");
          f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          f.add(this);
          f.add(label);
          f.pack();
          f.setLocationRelativeTo(null);
          f.setVisible(true);
      }
  </code></pre>
  
  <p>How can i achieve this</p>
  
  <p>Thanks in advance</p>