java - requestFocus() not working with show() method -


i'm making game program has show 1 panel, , panel show previous panel, , show first panel again. make things simpler, let's have panela , panelb in cardlayout c of panelc. program starts c.show(panelc, "panelb"); panelb.requestfocus();. then, in panelb, happens: c.show(panelc, "panela"). then, in panela, same thing happens again: c.show(panelc, "panelb"); panelb.requestfocus();

the first time around, requestfocus() works keylistener , game works fine. second time around when panelb shown, seems requestfocus not work , keylistener not respond events.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -