title: Zoom in and zoom out function in Jpanel
body: <p>I have to add <code>Zoom In and Zoom Out</code> functionality to <code>JPanel</code>, which contains components like <code>JLabel</code> with <code>ImageIcon</code>.</p>
  
  <p>I want to <code>Zoom JPanel</code> with their components appropriately 
  I tried with following code snippet but it did not work properly. </p>
  
  <p>The <code>JPanel</code> which is having <code>null</code> layout and is itself placed inside an <code>Applet</code>.
  I am unsure of the reason as to why it is not working either because of <code>Applet</code> or something else !!</p>
  
  <p><code>cPanel</code> is my <code>JPanel</code> which contains <code>JLabel</code></p>
  
  <p>Following code snippet on Zoom <code>Button</code> click,
  it shows blink screen on button click after that as original </p>
  
  <pre><code>Graphics g = cPanel.getGraphics();
  Graphics2D g2d = (Graphics2D) g;
  AffineTransform savedXForm = g2d.getTransform();
  g2d.scale(1.0, 1.0);
  g2d.setColor(Color.red);
  super.paint(g);
  g2d.setTransform(savedXForm);
  cPanel.validate();
  cPanel.repaint();
  </code></pre>