本文整理匯總了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());
}
示例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));
}
示例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;
}
示例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)));
}
示例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;
}
示例6: applyHeaderFooterStyle
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
public static void applyHeaderFooterStyle(@NotNull JBLabel label) {
label.setForeground(UIUtil.getLabelDisabledForeground());
}