Hi, new to java.

What i am trying to achieve, is to provide a swing component with a gradient background. I started off with a plain background, but even this won't work. Any ideas? I am trying a simple rectangle with a solid background to attach to a box. I realise i can use setbackground, but this is just a start.

Here is my code. Any help would be much appreciated, thanks.

Java Code:
private Box bxSide = Box.createVerticalBox();

private void buildSidebar() {
	//code omitted
	jfrmMain.add(bxSide, BorderLayout.WEST); 	

public void paintComponent(Graphics g) {
            Graphics2D g2d = (Graphics2D)g.create();
           // g2d.clearRect(0,0, bxSide.getWidth(), bxSide.getHeight());
            SwingUtilities.paintComponent(g2d, bxSide,this, 0,0,bxSide.getWidth(), bxSide.getHeight());