當前位置: 首頁>>代碼示例>>Java>>正文


Java JBLabel.setForeground方法代碼示例

本文整理匯總了Java中com.intellij.ui.components.JBLabel.setForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java JBLabel.setForeground方法的具體用法?Java JBLabel.setForeground怎麽用?Java JBLabel.setForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.ui.components.JBLabel的用法示例。


在下文中一共展示了JBLabel.setForeground方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createUIComponents

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
private void createUIComponents() {
  myNavigationControlsCombo = new ComboBox(new EnumComboBoxModel<Navigation>(Navigation.class)) {
    @Override
    public ListCellRenderer getRenderer() {
      return new ColoredListCellRenderer() {
        @Override
        protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
          append(((Navigation)value).getShortDisplayValue());
        }
      };
    }
  };

  myHelpAndErrorLabel = new JBLabel();
  myHelpAndErrorLabel.setBackground(JBColor.background());
  myHelpAndErrorLabel.setForeground(JBColor.foreground());
  myHelpAndErrorLabel.setOpaque(true);
  myHardwareSkinHelpLabel = new HyperlinkLabel("How do I create a custom hardware skin?");
  myHardwareSkinHelpLabel.setHyperlinkTarget(AvdWizardConstants.CREATE_SKIN_HELP_LINK);
  myCustomSkinPath = new SkinChooser(getProject());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ConfigureDeviceOptionsStep.java

示例2: TipPanel

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
public TipPanel() {
  setLayout(new BorderLayout());
  JLabel jlabel = new JLabel(AllIcons.General.Tip);
  jlabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
  JLabel label1 = new JLabel(IdeBundle.message("label.did.you.know"));
  Font font = label1.getFont();
  label1.setFont(font.deriveFont(Font.PLAIN, font.getSize() + 4));
  JPanel jpanel = new JPanel();
  jpanel.setLayout(new BorderLayout());
  jpanel.add(jlabel, BorderLayout.WEST);
  jpanel.add(label1, BorderLayout.CENTER);
  jpanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
  add(jpanel, BorderLayout.NORTH);
  myBrowser = TipUIUtil.createTipBrowser();
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myBrowser);
  add(scrollPane, BorderLayout.CENTER);

  JPanel southPanel = new JPanel(new BorderLayout());
  JCheckBox showOnStartCheckBox = new JCheckBox(IdeBundle.message("checkbox.show.tips.on.startup"), true);
  showOnStartCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
  final GeneralSettings settings = GeneralSettings.getInstance();
  showOnStartCheckBox.setSelected(settings.isShowTipsOnStartup());
  showOnStartCheckBox.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(@NotNull ItemEvent e) {
      settings.setShowTipsOnStartup(e.getStateChange() == ItemEvent.SELECTED);
    }
  });
  southPanel.add(showOnStartCheckBox, BorderLayout.WEST);

  myPoweredByLabel = new JBLabel();
  myPoweredByLabel.setHorizontalAlignment(SwingConstants.RIGHT);
  myPoweredByLabel.setForeground(SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES.getFgColor());

  southPanel.add(myPoweredByLabel, BorderLayout.EAST);
  add(southPanel, BorderLayout.SOUTH);

  Collections.addAll(myTips, Extensions.getExtensions(TipAndTrickBean.EP_NAME));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:40,代碼來源:TipPanel.java

示例3: getTableCellRendererComponent

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  JBLabel label = new JBLabel((String)value);
  label.setBorder(myBorder);
  if (table.getSelectedRow() == row) {
    label.setBackground(table.getSelectionBackground());
    label.setForeground(table.getSelectionForeground());
    label.setOpaque(true);
  }
  return label;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DeviceDefinitionList.java

示例4: HaxmAlert

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
public HaxmAlert() {
  myErrorInstructionsLink = new HyperlinkLabel();
  myWarningMessage = new JBLabel() {
    @Override
    public Dimension getPreferredSize() {
      // Since this contains auto-wrapped text, the preferred height will not be set until repaint(). The below will set it as soon
      // as the actual width is known. This allows the wizard dialog to be set to the correct size even before this step is shown.
      final View view = (View)getClientProperty("html");
      Component parent = getParent();
      if (view != null && parent != null && parent.getWidth() > 0) {
        view.setSize(parent.getWidth(), 0);
        return new Dimension((int)view.getPreferredSpan(View.X_AXIS), (int)view.getPreferredSpan(View.Y_AXIS));
      }
      return super.getPreferredSize();
    }
  };
  this.setLayout(new GridLayoutManager(2, 1));
  GridConstraints constraints = new GridConstraints();
  constraints.setAnchor(GridConstraints.ANCHOR_WEST);
  add(myWarningMessage, constraints);
  constraints.setRow(1);
  add(myErrorInstructionsLink, constraints);
  myErrorInstructionsLink.setOpaque(false);
  myWarningMessage.setForeground(JBColor.RED);
  myWarningMessage.setHorizontalAlignment(SwingConstants.LEFT);
  setOpaque(false);
  this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Recommendation"),
                                                    BorderFactory.createEmptyBorder(0, 5, 3, 5)));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:HaxmAlert.java

示例5: getTableCellRendererComponent

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
  JBLabel label = new JBLabel((Icon)value);
  if (table.getSelectedRow() == row) {
    label.setBackground(table.getSelectionBackground());
    label.setForeground(table.getSelectionForeground());
    label.setOpaque(true);
  }
  return label;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:AvdDisplayList.java

示例6: applyHeaderFooterStyle

import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
public static void applyHeaderFooterStyle(@NotNull JBLabel label) {
  label.setForeground(UIUtil.getLabelDisabledForeground());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:AbstractCustomizeWizardStep.java


注:本文中的com.intellij.ui.components.JBLabel.setForeground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。