i'm trying add 2 images inside jscrollpane. first image background , second 1 overlap first one. problem shows second image when run program!
please help
imageicon ii = new imageicon("mini_map.png"); jlabel label1=new jlabel(ii); icon icon = new imageicon("mg.gif"); jlabel label2 = new jlabel(icon); jscrollpane jsp=new jscrollpane(); jsp.getviewport().add(label1); jsp.getviewport().add(label2 );
jviewport single-child container, can't add 2 components.
to achieve overlap (that stack components in z-direction) in any container, you'r on own, built-in support poor. either have manage them in layeredpane (as mentioned already) or try overlaplayout
Comments
Post a Comment