How to draw semi circle

I am developing a small application in Java. I am using Java2D Library for drawing some graphical objects. Now i want to draw some semi-circle like shape or in simple words i need to draw this ( shape and this ) shape. I didn't find any function for drawing semi-circle, but i guess that Arc2D.Double(. . .); will work for me, so i tried it but i didn't understand what params i need to pass to its constructor. So i end up with the strange kind of shape :(

Could some one explains these params in detail or refer to some good link.


To draw (

Arc2D.Double(x, y, w, h, 90, 180, Arc2D.OPEN)

And for )

Arc2D.Double(x, y, w, h, 90, -180, Arc2D.OPEN)

The parameters are explained here: Arc2D.Double

The method I have used here is: Arc2D.Double(double, double, double, double, double, double, int)

This link can also help.


I can't figure out why the output is different. The output is same only in the range -128 to 127. public class Check { public static void main(String[ ] args) { Integer i1=122; ...

When I was doing JSP/Servlet programming, whenever I dropped 3rd party libraries into the WEB-INF/lib folder, they were automatically included in the project classpath. In GWT, this is not the case. ...

what is the difference between facade design and abstraction in java? i simply feel that it is as simple as interface in java and serve the same purpose. I saw more about people saying that it is a ...

I have a List, and I want to loop through that List and remove some record base on some condition. Here is what I do public void foo(List<Bar> recordList){ for(Bar bar : recordList){ ...