Random java question oof

Okie dokie so i’m at a hackathon right now and it’s like 1 am but anyways does anyone know if you can do graphics in java while being able to ask the user for input? Like I need it so that we can display an image on the screen but also be able to print the question that we are asking the user. I don’t know if my question made any sense because i’m very sleep deprived but like any help would be appreciated.