1.0.0
This commit is contained in:
1 parent
e25721e114
commit
0eeff6379f
55 files changed
+3504
-3
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package tech.carcadex.kotlinbukkitkit.tooling.menu
|
||||
|
||||
import com.intellij.util.ImageLoader
|
||||
import tech.carcadex.kotlinbukkitkit.tooling.Assets
|
||||
import java.awt.Graphics
|
||||
import java.awt.Image
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import javax.imageio.ImageIO
|
||||
import javax.swing.JPanel
|
||||
|
||||
|
||||
class ImagePanel : JPanel() {
|
||||
private var image: Image? = null
|
||||
|
||||
init {
|
||||
|
||||
try {
|
||||
image = ImageIO.read((File(MenuPreviewFileEditorProvider.ASSETS_FOLDER.absolutePath + "/items-13/acacia_boat.png")))
|
||||
} catch (ex: IOException) {
|
||||
// handle exception...
|
||||
}
|
||||
}
|
||||
|
||||
override fun paintComponent(g: Graphics) {
|
||||
super.paintComponent(g)
|
||||
g.drawImage(image, 0, 0, this) // see javadoc for more info on the parameters
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user