java - Multiple Jpanel keylistener space -
i have frame contains 4 different panels.one panels contains music player on pressing space key start playing music while other 3 panels contains textfields , submit buttons.now problem while typing text in of textfield it's taking input whenever try give space in textfield it's playing music instead of typing space in textfield.
i have frame contains 4 different panels.one panels contains music player on pressing space key start playing music while other 3 panels contains textfields , submit buttons.now problem while typing text in of textfield it's taking input whenever try give space in textfield it's playing music instead of typing space in textfield.
and
the listener attached music panel , not else
add keybindings jframe (contains 4 jpanels)
output should swing action
override setenabled in swing action
add jcomponents (for users input only) array
add focuslistener or jcomponents (for users input only)
on focusgained a.m. jcomponent added array should changed
but how can reset isenabled(true) swing action, swing timer
flamewars
not users friendly, quite impossible, wrong idea bunch side effects
wrong, wrong, wrong, can't determine keyshortcuts can used inputs chars jtextcomponents, jslider, jcombobox (autocomplete too), jtable iscelleditable(true)
space used accelerator jbutton (keybindings implemented in api) too, etc...
use jtogglebutton instead of jpanel,
has 2 states
can undecorated, looks jpanel (for example)
use icons, put there play (stop) icons, text, see there few times animated gif
space accelerator (on focusgained)
accesible mouseevents too