JPanels by default are focusable, so either override isFocusable or call setFocusable: 1. I'm using System.out, not dialogs, since a dialog's display would cause and endless triggering of focus gained and lost! 2. Why do you want a JPanel to be focusable? It's usually user-input controls, not containers that can get focus.
There is no emoticon for what I am feeling!
cat cater
Ranch Hand
Joined: Jun 06, 2005
Posts: 39
posted
0
Uses setFocusable (true) the method not to achieve the anticipatedeffect. focusGained and focusLost hasnot been triggered.JMyPanel is joined to other vessel in.
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
Sincd my example does work, I suggest you post a minimal complete program demonstrating your problem.
cat cater
Ranch Hand
Joined: Jun 06, 2005
Posts: 39
posted
0
First,I thank your help extremely But JPanel only then time obtains the focal point the opportunity. I want to press the Jpanel and get focal.. JButton and other input components May duplicate obtains the focal point. Has any method to be possible to change this kind of aspect?
Jeff Albertson
Ranch Hand
Joined: Sep 16, 2005
Posts: 1780
posted
0
I *really* didn't understand that last post. Again, if you could post a minimal example program that demonstrates your problem, that would go a long way in helping forums members help you.