File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

button not working, please help

 
Madhan Kumar
Greenhorn
Posts: 7
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, my headache is over for now.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic