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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Scientific
Posts: 90
Registered: ‎06-04-2010
My Carrier: verizon

Improve my custom screen look

Hello, I have a custom screen that I making popup on top of my other screen.  I would like to make this custom screen a box with rounded corners but when I try my code it always comes out more square looking.  How can I make this more rounded looking?

 

Here is my code for the layout and paint method:

 

         protected void sublayout(int width, int height)
	{
		layoutDelegate(width - 60, height - 60);
		setPositionDelegate(0, 10);
		setExtent(width - 60, Math.min(height - 60, getDelegate().getHeight() + 10));
		setPosition(30, (height - getHeight())/2);
		
	}
	protected void paintBackground(Graphics graphics)
	{
		graphics.setColor(0x333333);
		graphics.fillRoundRect(0, 0, getWidth(), getHeight(), 12, 12);
		graphics.setColor(0xffffff);
		graphics.drawRoundRect(0,0, getWidth(), getHeight(), 12, 12);
	}

 Thanks

 

Scientific

Please use plain text.