I just wrote my first JAVA application, and I am wondering what I have to do to make sure the Frame of my application will always be filled with the image.
I do not care if the image is here and there slightly bigger than the frame, but the frame can't be bigger than the image, ever.
I read and googled a lot already, but there was nothing to be found concerning my conditions, I think..
This is my code, hope you can give me some helpful hints:
public AdventureTrails() {
setTitle("AdventureTrails - Desktop-Application");
setSize(1000,600);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
setLayout(new BorderLayout());
setContentPane(new JLabel(new ImageIcon(AdventureTrails.class.getResource("src/background.jpg"))));
setLayout(new BorderLayout());
initMenu();
initComponents();
// Just for refresh :) Not optional!
setSize(999,599);
setSize(1000,600);
}