I coded a program where you can insert coordinates and the size of an sqaure and draw it on a JPanel
. I used:
panel.getGraphics().drawRect(x,y,h,b);
Now I want to add an color-chooser like that:
color Farbe = JColorChooser.showDialog(null, "Color-Chooser", null);
So now how do I draw the Square with color? I tried this but it doesn't work:
panel.getGraphics().drawRect(x,y,h,b, Farbe);