img = getImage( getClass().getResource( getParameter("img")) ); redImg = createImage(new FilteredImageSource(img.getSource(), new ColorMaskFilter( Color.red ))); greenImg = createImage(new FilteredImageSource(img.getSource(), new ColorMaskFilter( Color.green ))); blueImg = createImage(new FilteredImageSource(img.getSource(), new ColorMaskFilter( Color.blue )));
int width = getSize().width, height = getSize().height; g.drawImage( redImg, 0, 0, width/3, height, this ); g.drawImage( greenImg, width/3, 0, width/3, height, this ); g.drawImage( blueImg, 2*width/3, 0, width/3, height, this );