I am very much new to Java so please bear with me.
I have a class that draws a picture called PictureRenderer, one of my methods is:
public class PictureRenderer extends JPanel implements MouseListener, MouseMotionListener, PropertyChangeListener {
//Begin First Method
private int drawPicture( int[] checks, int maxCheckCount, Graphics g) {
//code here
}
}
Then I have a rest controller:
@CrossOrigin(origins = "*", allowedHeaders = "*")
@GetMapping(value = "/servlet/checkRequest")
String getCheckRequest {
PictureRenderer renderPic = new PictureRenderer();
try {
renderPic.drawPicture(2, 2, g);
} catch (Exception e) {
System.out.println("Exception caught " + e);
}
return "Good job?!"
}
My question is how do I get this to work? Ultimately what I want is since I have code that creates the picture already, I want to send it over to my website as I want to move away from JPanel. Please let me know if you need any other information.
Thank you for your help!!