Code example for JLabel

Methods: setBackgroundsetBordersetForegroundsetOpaque

0
  } 
 
 
  private JLabel createPopup()
  { 
    final JLabel label = new JLabel(Messages.getString("StatusBar.Inspection.Message"));
    label.setForeground(new Color(0, 0, 0));
    label.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.YELLOW),
        BorderFactory.createEmptyBorder(8, 8, 8, 8)));
    label.setBackground(new Color(255, 255, 0, 125));
    label.setOpaque(true);
 
    final Timer t = new Timer(5000, new ClearWarningMessageAction(label));
    t.setRepeats(false);
    t.start();
    return label;
  } 
 
  public void notifyInspectionStarted() 
  { 
Contextual code suggestions in your IDE  Get Codota for Java