Hi I have added JButton in my panel. Further I have added actionlistener for that button as well.
My problem is when I click on the button actionPerformed() method is not called. And if I move to that button using keyboard and press space, at that time actionPerformed() method is called.
I am executing the program from Eclipse. I tried with rebuilding, cleaning option of eclipse
Even I restarted eclipse and my machine but could not get rid of this problem
Can anyone help me out?
I found something else to add.
Its not only about button action thing.
Even I click on textfield, focus is not coming on textfield.
When I click on combo box, its not showing the values it has
But when I take control from key board its working.
So, with mouse there is some problem in accessing controls but I can access easily with key board.
One more thing, it was working fine earlier and stopped working one day when I start my eclipse.
if you're sure it's a program problem, and not that your mouse is erratic i.e. other programs work fine with mouse,
write a small program, just a JFrame with panel, panel with button/textfield and listeners.
make sure it displays the problem you've described, then post that code so we can see/test it.
I am sure it's not program problem but some other issue. May be some setting issue. Because the same code is working fine on my peer's machine.
I expect some hint from you that what could be wrong on my machine? Like version mismatch or something like that
can only help if it's a swing problem
if you think it may be an eclipse issue, perhaps the IDE forum might be worth posting in
if its an OS problem, General Computing might be the Forum
Imran Vohra wrote:I am sure it's not program problem but some other issue. May be some setting issue. Because the same code is working fine on my peer's machine.
I expect some hint from you that what could be wrong on my machine? Like version mismatch or something like that
My guess: you have a bug in your code. We'll probably be able to give you better help if you can create and post an SSCCE.
I got the solution
It was JRE version issue.
I was executing project with JRE6 and it was giving me the problem.
Once I change it to JRE5, my problem is solved