Don't use a null layout!!!
Swing was designed to be used with layout managers. Let each component determine its preferred size and then let the layout manager size and position the component based on the rules of the layout manager.
Instead of doing custom painting you can use Darry'ls Stretch Icon. The Icon will be painted based on the space available to the icon.
i have encountered a problem where the image is to big for the JLabel
Just reread that part of the question. In that case you may want to use the Image.getScaledInstance(...) method to scale the image to an appropriate size. The you can use a regular Icon and the appropriate layout manager.
what layout would i be able to use to easily choose the dimensions and where the objects are positioned
You are not supposed to choose the size/location of a component. That is the job of the layout manager. Read the tutorial on Layout Managers and choose the one (or combination of layout managers) that is appropriate for your requirements.
Chit, before I saw your answer, I closed the question as duplicate with a link to one of your answers. Coincidence? Too strange! 1 +
Ok, what layout would i be able to use to easily choose the dimensions and where the objects are positioned with out being restricted by things like grids from GridBagLayout?
I looked at what layout I'm using and I'm using the absolute layout which allows me to set absolute values to the location and dimension of my components.
@TomT, AbsoluteLayout is not really a layout. Again you should NOT be using absolute values to determine the location and size of components. Each component may have a slightly different LAF on different platforms.
@HovercraftFullOfEels, good coincidence but I may have been a little to quick to answer. The question is not really about dynamically resizing an image, but containing the maximum size of an image. Anyway all these answers give the OP some ideas.