Re: Handling private jtextfields
Jl_G_0 wrote:
Ill give it a try.
The real problem is trying to set and get values from private
JTextFields from another class. Its not my code entirely, so I dont
know how much I can change on the structure.
There's that word "private" again ...
Objects are not private or protected or public or
whatever; the access control mechanisms have nothing
to do with them. One easy way to see this is with a
simple (and rather silly) class:
class Silly {
private Integer priv = new Integer(42);
protected Integer prot = priv;
public Integer publ = priv;
Integer dflt = priv;
}
Each Silly instance "wraps" an Integer instance -- but
is that Integer private, or protected, or public, or
package-private? It's just one Integer object, so it
can't have all these different access levels at the
same time! In fact, the Integer has *no* access level;
accessibility doesn't mean anything for objects.
So when you refer to "private JTextFields from
another class," I don't know what you're talking about.
And I rather suspect you don't know, either: it seems
likely that you're trying to understand Java by applying
notions from another framework, and that the analogies
are not close enough to be useful.
--
Eric.Sosman@sun.com