This Java program draws a heart shape using the Swing library, creating an animated display of the drawing. The heart is generated using parametric equations and displayed in a JFrame.
This program utilizes Java and the Swing library to draw a heart shape on a graphical user interface (GUI). The heart shape is generated by parametric equations, allowing for customization of the heart's size and color. The program provides an animated display of the drawing.
-
Clone the repository to your local machine:
git clone https://github.com/Mustfa-IT/HeartDrawing.git
-
Open the project in your preferred Java development environment.
-
Run the
Programclass.
Run the program, and a JFrame window titled "Drawing Heart" will appear, displaying an animated heart drawing. The heart size, precision, and color can be customized by modifying the variables in the Program class.
The following variables in the Program class can be configured:
width: Width of the JFrame window.height: Height of the JFrame window.heartSize: Size of the heart.precision: Precision of the heart shape drawing.color: Color of the heart shape.
Modify these variables as needed to achieve the desired heart shape and appearance.
If you'd like to contribute to the project, feel free to fork the repository and submit a pull request. Bug reports, feature requests, and general feedback are also welcome!
This program is licensed under the MIT License.