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);
}
}
Also in Java:
- protect java
- number to char java
- loop while in java
- java parse xml string
- BoxLayout java
- padding a string with 0 in java
- string to double java exception
- how to get length of integer in java
- Compilation is not supported for following modules: android. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project
- length of string java
- do while loop java
- how to reverse a list in java
- entre clavier java
- how to check if a string is in alphabetical order in java
- get first 5 characters of string java
- write an infinite loop java
- java merge sort
- java regex replace all characters before
- best companies to workk in
- write file from a specific location in java
- java random integer
- java observable to observer stack overflow
- java int array
- create java windows application