Any one could please help me to give idea "how to draw a rectangle using mouse in Jpanel" and it should allow to draw more than one rectangle or other shapes.. if anyone have sample code please give it and help me... thanks in advance.
add a mouseListener to the panel mousePressed get the x/y coords mouseReleased get the x/y coords and repaint() paintComponent() has graphics.drawRect(coords)
Please CarefullyChooseOneForum when posting at the Ranch. This question ought to have gone to the Swing Forum, where I'm moving it now. [ January 10, 2006: Message edited by: Ernest Friedman-Hill ]