I have a JFrame in which I have drown a background:
class ImagePanel extends JComponent {
private Image image;
public ImagePanel(Image image
you should create a simple List Cell Renderer and call it in your listName.setCellRenderer(new YourListCellRenderer());
Eg:- Your List Cell Renderer Code should something like this
public class MyListCellRender extends DefaultListCellRenderer {
@Override
public Component getListCellRendererComponent(JList> list1, Object obj, int index, boolean isSelected, boolean isFocus) {
super.getListCellRendererComponent(list1, obj, index, isSelected, isFocus);
setForeground(Color.WHITE);
setOpaque(isSelected);
return this;
}
}
then in call it in what or wherever you want like form active event or initial stage in my case I callit in initial Stage which after form create.It mean after initComponent();
initComponents();
jList1.setUI(new WebListUI());
scrollBar.setOpaque(false);
scrollBar.getViewport().setOpaque(false);
jList1.setOpaque(false);
jList1.setCellRenderer(new TransparentListCellRender());
This is my Sample