Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button not working, please help

 
Madhan Kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change
JButton buser=new JButton("Users");
to
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
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, my headache is over for now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic