this JPanel is added to JFrame's DRAG LAYER dynamically, when user presses the key "Alt + RIGHT ARROW"
and will be removed when ALT key is released or arrow key is pressed when alt is holding down
ISSUE: when i pressed Alt + RIGHT ARROW, panel is shown empty, please explain me why it is behaving so?
Intention of writing the code is to achieve the functionality of Alt+Tab of any OS
Code you can find in the attachments
Also explain me which is correct way of doing,
prepare JPanel with the components, set its bounds, add it to JLayeredPane
or
add all the components to JLayeredPane by setting their bounds, and add JLayaredPane to the JPanel


Sign In
Create Account



Back to top









