when I have JPanel, it has it´s default Graphics which is passed to paint(Graphics g) and similiar function. Can I somehow switch that default Graphics for my own? From outside of the JPanel class? I am looking for something like JPanel.setGraphics(Graphics g). Thank you.
when I have JPanel , it has it´s default Graphics which is passed to
Share
No, but you may override its
paintComponentmethod, cast theGraphicsobject passed as argument toGraphics2D, and draw whatever you want on it.