java create circle
// x position, y position, x size, y size.
ellipse(0, 0, 100, 100);
java create circle
// x position, y position, x size, y size.
ellipse(0, 0, 100, 100);
how to create a circle in java
public class scratch {
public static void main(String[] args) {
JFrame window = new JFrame();
window.setTitle("Christmas Tree");
window.setSize(700, 600);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
DrawingComponent DC = new DrawingComponent();
window.add(DC);
}
}
class DrawingComponent extends JComponent{
public void paint(Graphics graph0){
Graphics2D graph = (Graphics2D) graph0;
Ellipse2D.Double circle = new Ellipse.Double(5, 5, 25, 25);
graph.fill(circle);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us