swing - Java Layer JPanels -
i need layer jpanels don't know how. have 3 panels, first background, second character/sprite move around , layers first panel(background, , third bar off side (used buttons , has nothing layers). how layer panel 1 , panel 2?
edit: background made of grid of 25x25 labels icon in each.
some options:
- use jlayeredpane can layer components using z-order integer constant. remember when doing this, using null layout, , responsible setting size , position of components added jlayeredpane.
- if background doing painting image, use single jpanel, , paint image bufferedimage displayed in jpanel's paintcomponent method. sprite painted location vary.
Comments
Post a Comment