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

Posts: 31
Registered: ‎10-18-2010
My Device: Bold 9700
Accepted Solution

Handle row focus on custom list

I'm using the code at this page to display a custom list. The problem I'm having now is that I want to handle the onFocus event of each row in the list to change it's background color. Any idea how to do so?

Posts: 26
Registered: ‎11-30-2010
My Device: Not Specified

Re: Handle row focus on custom list



You are having method DrawListRow in that you have to set color like below



	public void drawListRow(ListField listField, Graphics g, int index, int y,
			int width)
		if (g.isDrawingStyleSet(Graphics.DRAWSTYLE_FOCUS))
		} else
// then draw rect

                g.drawRect(0, y, width, 80);
//draw text in list
                g.drawText("Blackberry", 90, y + 9);


feel free to press the kudos button on the left side to thank the user that helped you.
please mark posts as solved if you found a solution.