What is the problem with this code please tell.When on clicking the button,i am attempting to write text in textfield t1,it is not able to recognize t1 although i have declared it

0 views
Skip to first unread message

shahid fazal

unread,
Feb 21, 2010, 8:11:15 PM2/21/10
to jugn...@googlegroups.com
mynew1.java

Tushar Joshi

unread,
Feb 21, 2010, 9:28:11 PM2/21/10
to jugn...@googlegroups.com
Shahid,

1) Please learn access specifiers and their usage in any Java book.
2) The variables which are referenced from many methods and classes must be defined at class level as fields.
3) t1 is not available to the action listener class as it is defined in another method

with regards
Tushar

==============================================
Tushar Joshi, Nagpur
MCSD_NET C#, SCJP, RHCE, ZCE, PMP
Software Architect @ Infospectrum India Private Limited, JUGNagpur Leader
http://www.info-spectrum.com
http://www.tusharvjoshi.com
http://www.jugnagpur.com


On Mon, Feb 22, 2010 at 6:41 AM, shahid fazal <shahid...@gmail.com> wrote:

--
---------------------------------------------------------------------------------------------------------------
Java User Group Nagpur
Home Page: http://www.jugnagpur.com
Blog: http://jugnagpur.blogspot.com
Wiki: http://jugnagpur.wikispaces.com/
Project Page: https://jugnagpur.dev.java.net/
---------------------------------------------------------------------------------------------------------------
You received this message because you are subscribed to JUGNagpur group.
To post to this group, send email to jugn...@googlegroups.com
To unsubscribe from this group, send email to
jugnagpur+...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/jugnagpur?hl=en

Rajesh Ingle

unread,
Feb 21, 2010, 11:52:43 PM2/21/10
to jugn...@googlegroups.com
U have declared t1 in constructor of outer class (scope of this is constructor only) and trying to access in inner class. Declare t1 in class then access it in inner class using object of outer class or make it static and access using class name. corrected code is attached

Rajesh Ingle, 9766698067

--- On Mon, 22/2/10, shahid fazal <shahid...@gmail.com> wrote:


From: shahid fazal <shahid...@gmail.com>
Subject: [jugnagpur] What is the problem with this code please tell.When on clicking the button,i am attempting to write text in textfield t1,it is not able to recognize t1 although i have declared it
To: jugn...@googlegroups.com
Date: Monday, 22 February, 2010, 6:41 AM


--
---------------------------------------------------------------------------------------------------------------
Java User Group Nagpur
Home Page: http://www.jugnagpur.com
Blog: http://jugnagpur.blogspot.com
Wiki: http://jugnagpur.wikispaces.com/
Project Page: https://jugnagpur.dev.java.net/
---------------------------------------------------------------------------------------------------------------
You received this message because you are subscribed to JUGNagpur group.
To post to this group, send email to jugn...@googlegroups.com
To unsubscribe from this group, send email to
jugnagpur+...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/jugnagpur?hl=en


Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!.
mynew1.java
Reply all
Reply to author
Forward
0 new messages