How to fit an image in a window so that the taskbar does not cover it over.

Hey all,

 So I've bumped into some issues with putting a background in a program I've been working on recently. The program uses relative positioning in Swing to lay out all of the gui components and creates different scaled images for the background based on the window size which is in turn based on the screen size.

 The JFrame takes up the whole screen, and while I could shrink the window so that the taskbar didn't lay on top of it, how I can tell how big the taskbar is, how I can tell where it's located on different computers, ect are real problems.

 Is there any way I could track the size and location of the taskbar and adjust the image accordingly? 

Current background code:


//Outside of constructor:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
double width = screenSize.getWidth();
double height = screenSize.getHeight();
int intHeight = (int)height;
int intWidth = (int)width;	




//set the size of the JFrame, order matters
	this.setSize(intWidth, intHeight);


	Dimension screenSize = this.getBounds().getSize();
	 width = screenSize.getWidth();
	 height = screenSize.getHeight();
	int intHeight = (int)height;
	int intWidth = (int)width;
	
	
	//Create the icon for the background label
	//note, I took some forum advice here and I'm not 100% clear on what the graphics class does
	try{
	final ImageIcon wp = new ImageIcon(getClass().getResource("/layouttest.png"));	
	  Image wallPaper = wp.getImage();
	 
	  //This code section brought by the recommendations of stack overflow and slightly modified
	  Image scaledImage = wallPaper.getScaledInstance((int)width, (int)height, Image.SCALE_FAST);
      BufferedImage backgroundBuff = new BufferedImage((int)width, (int)height, BufferedImage.TYPE_INT_RGB);
      Graphics g = backgroundBuff.createGraphics();
      g.drawImage(scaledImage, 0, 0, new Color(0,0,0), null);
      g.dispose();
	

	ImageIcon newIcon = new ImageIcon(scaledImage);
	JLabel background =  new JLabel(newIcon);
	contentPane.add(background, new Integer(0));
	size = background.getSize();
	background.setBounds(0, 0, intWidth, intHeight - 50);
	backgroundSize = background.getSize();
	}
	catch (Exception e)
	{
		System.out.println("Error, file not found");
	}
	

Any help at all would be very much appreciated.