开发者

Java: How to view icon overlapping each other

开发者 https://www.devze.com 2023-04-07 06:49 出处:网络
JLab开发者_运维技巧el l1 = new JLabel( new ImageIcon( ... ) ) ; JLabel l2 = new JLabel( new ImageIcon( ... ) ) ;
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

精彩评论

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