Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get protected variable  RSS feed

 
Henry Addo
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The JCheckBox class has a method,
paramString() that return a protected string
and i want to make a use of that method paramString
and this what i did,
i declared a protected string and equated it to the method,
when a compile a get and error, the method has a protected access.
Please help me on how i should go about it. Thanks in advance.
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Henry,

There are no 'protected string' concept in java. In the satement
protected returntype myMethod(), the access restriction (protected) apply to the method (not to the return type).

In your case, this means you can only call paramString() from inside the JCheckBox package or from a class that extends JCheckBox.

You may found useful to read some tutorial on this.

As far as I understand what you want to do, you might try this

Hope that helps,
 
Henry Addo
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will try that i just want to get the
text of the JCheck box i will try your code
thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!