• Post Reply Bookmark Topic Watch Topic
  • New Topic

Repainting my buttons does not work  RSS feed

 
Raffael Haberland
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I'm trying to make a nice vector game.
The algorithm is quite easy, you start with a numer you choose between 3 an 5.
For example, you choose 3 so the next turn could be 2, 3or 4 (3-1, 3again or 3+1).

I'm writing those numbers in an array and update them.

My Array looks like this for example:

[4|0|0|3|4|5|0|...|0]

than I make the next step with 3 for example:
[4|0|0|3|0|2|3|4|0|0|...|0]

than I make the next step with 4 for example:
[4|0|0|3|0|0|0|4|0|0|3|4|5|0|0|...|0]

But when I try to get it in an gui, I fail.
I make Buttons which are enable when they are not 0
and lable them like the number in the array.

Until here, I have no problems.

But when I press a butten, the buttons will not change.

Here's my Code:
Button class


Module class


Gui class


and start class



Please help me!



 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why have you got so many static members in those classes? That looks very dubious design to me. Also why do you have non-private members?
 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Raffael Haberland
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Why have you got so many static members in those classes? That looks very dubious design to me. Also why do you have non-private members?


Thank you. I dont know, eclipse tould me I should make them static.
But I guess tht should be not the problem, because the name and enanbled are non static.
I can make them privat later, when I resolve my problem with the gui.

But thank you for your guess and the fast answer!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!