0

So I am Using the drag and drop function in netBeans and I have created a background using a JLabel icon, however when I maximize the window or even drag it to a bigger parameter the icon(background image stays the same size).

what can I do to fix this problem? thank you.

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • It depends in the layout manager.Using `BorderLayout` and adding using `add(jLabel,BorderLayout.CENTER);` might help. Post an [MCVE] demonstrating the problem. – c0der Sep 24 '16 at 13:01
  • Don't use a JLabel to do this as you add layers of complexity trying to re-size an ImageIcon. Instead, draw the image in the paintComponent method of a JPanel, one added BorderLayout.CENTER in your BorderLayout-using JFrame, and resize the image as per the duplicate question. – Hovercraft Full Of Eels Sep 24 '16 at 13:19
  • For other similar questions, and to see how to search for similar questions for your future problems, please see [this Google link that searches this site](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=site:stackoverflow.com+java+swing+resize+background+image). – Hovercraft Full Of Eels Sep 24 '16 at 13:21

0 Answers0