Shape Drawer

This Java program allows you to draw basic shapes (triangle, rectangle, circle) on a graphical interface.

How to Use:

Launching the Program: Run the program by executing the main method in the ShapeDrawer class. Upon execution, a window titled "Shape Drawer" will appear. Selecting a Shape: Use the drop-down menu to select a shape you want to draw: Triangle, Rectangle, or Circle. Entering Dimensions: Depending on the selected shape, you may need to enter one or two dimensions: For the Triangle: Base and Height. For the Rectangle: Width and Height. For the Circle: Radius. Enter the dimensions in the respective text fields. Drawing the Shape: After entering the dimensions, click the "Draw" button. The shape will be drawn on the drawing panel below the input fields. Error Handling: If you enter invalid dimensions (e.g., negative values, non-numeric characters), an error message will prompt you to enter valid dimensions. Ensure you provide valid inputs to draw the shapes accurately. Notes:

The shapes are drawn with predefined colors: Triangle (Blue), Rectangle (Green), Circle (Red). The drawing panel is located at the bottom of the window, where the shapes will be displayed. You can draw multiple shapes successively by selecting different shapes and entering dimensions. Additional Information:

This program utilizes Java's Swing library for creating the graphical user interface (GUI). Error messages are displayed using Java's JOptionPane for user-friendly error handling. The code is structured with separate methods for drawing each shape to ensure modularity and readability. Feel free to modify and expand upon this code for more advanced functionalities or additional shapes.