Ejemplo n.º 1
0
 /**
  * Extracts the buffered image of some component
  *
  * @param myComponent the component for which the BufferedImage is required
  * @param region region to be captured
  * @return the BufferedImage which has the current condition of component
  * @throws IOException
  */
 public static BufferedImage Get_Component_Image(Component myComponent, Rectangle region)
     throws IOException {
   BufferedImage img =
       new BufferedImage(
           myComponent.getWidth(), myComponent.getHeight(), BufferedImage.TYPE_INT_RGB);
   Graphics g = img.getGraphics();
   myComponent.paint(g);
   g.dispose();
   return img;
 }
Ejemplo n.º 2
0
    /** refreshes the parents */
    protected void refreshParents() {

      if (componentToRefresh != null) {

        componentToRefresh.repaint();
      }
    }