Code example for JList

Methods: getForegroundgetSelectionBackgroundgetSelectionForeground

0
    /** Creates a new instance of DefaultDayRenderer. */ 
    public DefaultDayRenderer() { 
        cal = Calendar.getInstance();
         
        // Fake solution: by now steal colors from a JList 
        JList jl = new JList();
        unselectedbg = Color.white;
        unselectedfg = jl.getForeground();
        selectedbg = jl.getSelectionBackground();
        selectedfg = jl.getSelectionForeground();
        setVerticalAlignment(CENTER);
        setHorizontalAlignment(CENTER);
        setOpaque(true);
        notworking = new Color(240, 240, 255);
    } 
     
    /** 
     * Returns a component configured to render the Day. 
     * @return component to be used 
     * @param daypanel Daypanel to be renderer 
Experience pair programming with AI  Get Codota for Java