Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+12 votes
asked in CSC305 Fall 2019 by (8 points)

Are you using the Swing library, or something else?
Can you be more specific in your question?

1 Answer

+5 votes

If you're using Swing...

To simply show an image that doesn't change, you can use a JLabel with an icon -- see https://stackoverflow.com/questions/3775373/java-how-to-add-image-to-jlabel .

If you're wanting to do more with the image, e.g. in the context of a game, you might look at the tutorials here: http://zetcode.com/tutorials/javagamestutorial/

answered by (16.7k points)