tags:

views:

29

answers:

0

In my application we are using customized look and feel. In Java 1.5 I am using one JComboBox and its popup border is not transparent it is coming in blue color. But in Java 1.6 this same combo box border is coming as transparent and not in blue color.

Any idea?

import java.awt.Dimension;

import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;

import com.laf.CuiLookAndFeel;


public class JComboBoxLAF extends JPanel {
 public static void main(String[] args) {
  try{
   UIManager.setLookAndFeel(new CuiLookAndFeel());
  }catch(Exception e){
   e.printStackTrace();
  }
  javax.swing.SwingUtilities.invokeLater(new Runnable(){
   public void run(){
    createAndShowGUI();
   }
  });
 }

 public JComboBoxLAF(){
  String[] contents = {"testContent1", "testContent2", "testContent3"};
  JComboBox test = new JComboBox(contents);
  add(test);
 }


 private static void createAndShowGUI(){
  JFrame frame = new JFrame("TestJComboBoxLAF");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  JComponent comp = new JComboBoxLAF();
  frame.setContentPane(comp);
  frame.setPreferredSize(new Dimension(300,100));
  frame.pack();
  frame.setVisible(true);
 }


}