This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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.
I agree. Here's the link:
subject: button not working, please help
It's not a secret anymore!