File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes button not working, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "button not working, please help" Watch "button not working, please help" New topic

button not working, please help

Madhan Kumar

Joined: Jan 09, 2006
Posts: 7
Hi, i am developing a chat application using sockets.I have used two panels in a frame. My problem is that the button in panel isnt working, i have used the same action event for both the panels.. i am adding here the part of my code..

My button when clicked has to display corresponding dialog box, but it fails to do so, what could be wrong please help. thanks in advance
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
JButton buser=new JButton("Users");
buser=new JButton("Users");

(Youre declaring buser as a local variable inside
the constructor. You need not declare it locally, because
you want it to reference the gloable instance.)
Madhan Kumar

Joined: Jan 09, 2006
Posts: 7
Thank you, my headache is over for now.
It is sorta covered in the JavaRanch Style Guide.
subject: button not working, please help