Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 5
Registered: ‎04-20-2010
My Device: 8700

Re how to refresh or redraw screen with a key input?

Hi there again everyone, I'm new here and I'm new to blackberry development. I'm really impressed I got a response for my previous problem which is now solved so thank you all.

For a student project I'm working on, I have a 2D array of ButtonFields, which I am using to create a Sudoku grid. I've got my input working now and I can modify the cells.

 

What I'd really like to do is then highlight each correctly completed row, column and 3x3 square once they have been filled in. Ive implemented this on the PC using looping to check the row and set the background colour of each custom button in that row once the user has keyed in the last correct number.

 

However on the blackberry, the row, col or square doesn't change background if for example I fill the first row with 1 - 9 . But if I go back and scroll over each cell the background does in fact change, suggesting the background has been changed but the screen has not been refreshed.

 

Is there any way of refreshing or redrawing the screen when a user keys a button? I'm really stuck here..


Thank you in advance and I hope I can return the favour soon

Developer
Posts: 16,518
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Re how to refresh or redraw screen with a key input?

invalidate()
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Contributor
Posts: 5
Registered: ‎04-20-2010
My Device: 8700

Re: Re how to refresh or redraw screen with a key input?

thank you so much, it worked like a charm

 

I was messing around with doPaint() getting nowhere

 

kudos!