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.
精彩评论