Created
February 25, 2015 12:34
-
-
Save codenameone/4253211d17484609709b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RectangleComponent extends Component { | |
@Override | |
protected Dimension calcPreferredSize() { | |
return new Dimension(250,250); | |
} | |
public void paint(Graphics g) { | |
g.setColor(0x0000ff); | |
g.rotate((float) (Math.PI / 4.0)); | |
g.drawRect(getX() + 5, getY() + 5, getWidth() - 10, getHeight() - 10); | |
g.rotate(-(float) (Math.PI / 4.0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment