I am using an Image inside the Panel and dialog box. when the image is loaded it doesnt fit to that panel, it seems like the image is gone half way. so my doubt is how to fit an image inside a panel or dialog box? even if i resize the frame or dialog box, the image must adjust according to its dimension.... plz help me out....
create a sub-classed JPanel, overriding paintComponent(Graphics g). in paintComponent you use g.drawImage(x,y,w,h,this) where x,y are usually 0,0 w,h are width,height
do not 'get' (or load) the image inside paintComponent