• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Repainting my buttons does not work

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!



 
Marshal
Posts: 79151
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Raffael Haberland
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
He got surgery to replace his foot with a pig. He said it was because of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic