Hello Meera,
Following code will give u a hint regarding how to go about it
import javax.swing.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.filechooser.*;
import javax.swing.event.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import javax.swing.table.*;
import javax.swing.text.Position;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.DateFormat;
import java.util.*;
import javax.swing.plaf.metal.*;
import java.awt.*;
public class testFileChooser extends JFrame{
Container cont = null;
JFileChooser files;
public testFileChooser(){
cont = getContentPane();
cont.setBackground(Color.white);
files = new CustomChooser();
files.setBounds(0,0,400,375);
files.setBackground(Color.white);
files.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
cont.add(files);
}
public static void main(
String args[]) {
testFileChooser tfc = new testFileChooser();
tfc.setSize(500,500);
tfc.setVisible(true);
}
}
class CustomChooser extends JFileChooser
{
public CustomChooser(){
super();
setUI( new CustomChooserUI(this));
}
}
class CustomChooserUI extends MetalFileChooserUI{
public CustomChooserUI(JFileChooser filechooser) {
super(filechooser);
}
public void installComponents(JFileChooser fc) {
super.installComponents(fc);
getBottomPanel().setBackground(Color.white);
getButtonPanel().setBackground(Color.white);
}
}