开发者

Java: How to view icon overlapping each other

JLab开发者_运维技巧el l1 = new JLabel( new ImageIcon( ... ) ) ;    
JLabel l2 = new JLabel( new ImageIcon( ... ) ) ;
l1.setBounds( 0, 0, 50, 50 ) ;
l2.setBounds( 10, 10, 50, 50 ) ;

That occupy some of the place of l1. If I want to view all the l1 ignoring l2, what should I write ?


Any of:

  • A JLayeredPane. See How to Use Layered Panes.
  • A custom layout. See Creating a Custom Layout Manager.
  • Custom painting. See Performing Custom Painting.

Could fulfill the requirement.

Here is a screenshot from the tutorial on layered panes.

Java: How to view icon overlapping each other

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜