Java-Circle and Color

Circle The Graphics class does not have any method for circles or ellipses. However, the drawOval( ) method can be used to draw a circle or an ellipse. Ovals are just like rectangles with overly rounded corners. The drawOval( ) method takes four arguments, the first two represent the top left corner of the oval … Read more…

JPanel,Color,setBackground,setBorder,createLineBorder,createMatteBorder

Border is the Swing interface that encapsulates a border. You can obtain a border by calling one of the factory methods defined by the BorderFactory class. The one used in the program is createLineBorder( ), which creates a simple line border. It is shown here: static Border createLineBorder(Color clr, int width) Here, clr specifies the … Read more…