public void setBackground(Color _color) { if((delegate_==this)||(delegate_==null)) super.setBackground(_color); else delegate_.setBackground(_color); }
/** * Change la couleur de fond du label en fonction de <code>_b</code>. */ void setLabelEnabled(final boolean _b) { if (_b) { lbPrevisu_.setBackground(Color.white); } else { lbPrevisu_.setBackground(this.getBackground()); } }
/** * initialise tous les labels qui afficheront des donnees. La couleur de font est blanche, le texte est aligne a * droite et une bordure est ajoutee. */ static final BuLabel initBuLabelDonnee() { final BuLabel r = new BuLabel(); r.setBackground(Color.white); r.setOpaque(true); r.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder( 2, 2, 2, 2))); r.setHorizontalAlignment(SwingConstants.RIGHT); return r; }
r.setBackground(bg); r.setHorizontalAlignment(a); r.setText(t);
private BuPanel createPreviewPanel() { final BuPanel center = new BuPanel(new BuGridLayout(2, 2, 2)); center.setBorder(CtuluLibSwing.createTitleBorder(CtuluLib.getS("Exemples"))); for (int i = 0; i < values_.length; i++) { final BuLabel lb = new BuLabel(values_[i].toString()); center.add(lb); label_[i] = new BuLabel(); center.add(label_[i]); label_[i].setBackground(Color.WHITE); lb.setBackground(Color.WHITE); lb.setHorizontalTextPosition(SwingConstants.RIGHT); lb.setHorizontalAlignment(SwingConstants.RIGHT); lb.setOpaque(true); label_[i].setOpaque(true); label_[i].setHorizontalTextPosition(SwingConstants.CENTER); label_[i].setHorizontalAlignment(SwingConstants.RIGHT); } return center; }
super.setBackground(((JList)_comp).getSelectionBackground()); super.setForeground(((JList)_comp).getSelectionForeground()); if(_comp instanceof JTree) super.setBackground(UIManager.getColor("Tree.selectionBackground")); super.setForeground(UIManager.getColor("Tree.selectionForeground")); if(_comp instanceof JTable) super.setBackground(((JTable)_comp).getSelectionBackground()); super.setForeground(((JTable)_comp).getSelectionForeground()); super.setBackground(_comp.getBackground()); super.setForeground(_comp.getForeground());
lbExample_.setHorizontalAlignment(SwingConstants.CENTER); lbExample_.setHorizontalTextPosition(SwingConstants.CENTER); lbExample_.setBackground(Color.WHITE); lbExample_.setOpaque(true); add(lbExample_);