Thursday, 15 August 2013

java - Adding a BufferedImage to a JPanel on JLayerPane -


Therefore, I have a zeledadpan (technically a class sub-clinging JellyheadPen in fact). There is a JPNL on that I want to add a buffard image to zipal.

  The public class Bigmat JLearpine implies the MouseListener JP Penal Map Panel; Buffeedmeremet; Public Bitmap (Buffer Image M) {theMap = m; MapPanel = new JPanel (); Addition (Map Panel, 0); MapPanel.setBounds (0, 0, 640, 640); // other unimportant stuff} @ Override Public Waste Paint Coment (Graphics G) {SuperPaintConant (G); Graphics 2D GPMap = (Graphics 2D) MapPanel.Graph Graphics (); Gmap.drawImage (map, empty, 0, 0); // some other things that are working fine now) The problem is that the buffed image is not showing JPNL is definitely present because I can choose my background and If I want, I can see it. I know that JLED is not a layout manager in the pen and they have to set the limit for the zippin but this should definitely not be an issue for JPNL? And in the buffeted image there is a lack of ways to control its size, I do not know how to remove it, if it is.  

Any help appreciated.

The problem here is that you paintComponent () method of your layered panel No, not JPanel . JPNL will paint later as one of the children of your layered panel, and erase the paints you make from it.

In general, a paintComponent () method should be painted in graphics , which was not given in graphics of any other component.

No comments:

Post a Comment