How to add an Image to Form in java

后端 未结 4 1517
梦谈多话
梦谈多话 2021-01-13 22:52

I am designing a form in java using JDeveloper. I am new to JDeveloper. In JDeveloper tool I didn\'t found any option to directly add image to form like .Net. And I don\'t k

4条回答
  •  借酒劲吻你
    2021-01-13 23:20

    Don't know about JDeveloper but in code you have following possibilities:

    1. Create an ImageIcon of the image then set that to a jLabel and add jLabel to your frame.
    2. Override paintComponents() of your frame to draw image using Graphics in it. {Not sure about this}
    3. Override paintComponent() of some panel or any other component to draw image using Graphics in it and then add that component to frame..

提交回复
热议问题