This is how I create rounded rectangles and if I create rounded rectangles in this fashion, the code cannot be reused.
But if I could create a Class Rounded Rectangle that extends Shape Class of
Java, I can use it anywhere and anytime.
Java AWT's GEOM class and Graphics2D class are not supported in my Virtual Machine environment, So the only way to create Rounded Rectangle is to use drawRoundRect function of Graphics class. But doing this way has so many disadvantages.
If I create 4 shapes, and if I want to add key listener to 4 shapes and on click of a shape a new screen should open, since I dont have Geom Class support, I cant store rounded rectangle shapes in an arraylist and access it. I have to every time detect the pixels space between 2 rounded rectangles to detect the Click event.
So I am looking for a possible code example of Rounded Rectangle created by extending Shapes class.