Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Import png to java from ms paint  RSS feed

 
Alaric Mustoe
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a png file and I want to import it into java how would i do that?
 
Tim Cooke
Marshal
Posts: 3872
233
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please define exactly what you mean by "import it into java"?
 
Campbell Ritchie
Marshal
Posts: 55707
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should be something useful in the Java┬« Tutorials, but you do not usually (as Tim has implied) “import” images. You can usually display them however.
 
Alaric Mustoe
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so what I mean is that I have a file in ms paint that is a png and I would like to import the file to use as a graphic in the program.
 
Tim Cooke
Marshal
Posts: 3872
233
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's "the program"? What GUI do you want to present it in? Web browser UI? Swing UI? JavaFX UI? Other?
 
Joshua Daniels
Greenhorn
Posts: 11
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to give you a solid answer because of the limited specifics but you might want to read this, it's about working with images, hope you find it really helpful!
 
salvin francis
Bartender
Posts: 1599
35
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alaric Mustoe wrote:Ok so what I mean is that I have a file in ms paint that is a png and I would like to import the file to use as a graphic in the program.

Hi, The simplest way in which you can achieve this is by using a JLabel.
Check this tutorial: JLabel Tutorial
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!