>Hi,
>I wrote a class counter_button, which extends JButton class.
So why are you posting this rubbish?
>public class counter_button
>{
...
This class extends Object, not JButton, and sure
does not have an ..
>con.add(my_button.prz);
..attribute by the name of 'prz'.
Try posting an SSCCE* - that explains much better,
but dump the 'other class' and put a little test main
in the custom button class.
* <http://www.physci.org/codes/sscce.html>
As an aside, common Java nomenclature suggests
this class should be called CounterButton, rather
than counter_button.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
mehafi@gmail.com - 11 Aug 2007 11:07 GMT
Hi,
how to write a CounterButton class, which should extends JButton
class, which task is to write on it own text number of its pressed.
Object of this class shoud be added to container like Standard JButton
( without any variables ):
container.add(my_counter_button)
instead:
container.add(my_counter_button.some_variable)
Lew - 11 Aug 2007 12:48 GMT
> Hi,
> how to write a CounterButton class, which should extends JButton
[quoted text clipped - 7 lines]
>
> container.add(my_counter_button.some_variable)
Did you read Andrew's response?
You didn't provide enough information to hint what the problem actually is.
Put together an SSCCE. (See Andrew's post for the link.) The likelihood is
that doing so will help provide you insight into your problem, and the
certainty is that it'll make it possible for us on the newsgroup to understand
and maybe help with the problem you're having.
As an aside, common Java nomenclature as promulgated by Sun and practiced
nearly universally suggest that class names be spelled with upper-case letters
at the beginning of the class name and of each subsequent compound word part,
with no underscores, thus MyCounterButton, rather
than my_counter_button.
Maybe someone can help without further details from you, but I don't see how.
Andrew gave you really good advice in this regard that you seem to have
disregarded.

Signature
Lew