本文整理匯總了Java中com.intellij.ui.components.JBLabel.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java JBLabel.setBackground方法的具體用法?Java JBLabel.setBackground怎麽用?Java JBLabel.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.ui.components.JBLabel
的用法示例。
在下文中一共展示了JBLabel.setBackground方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createViewPanel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JComponent createViewPanel() {
final String png = myCell.getBase64String();
final JBLabel label = new JBLabel();
if (!StringUtil.isEmptyOrSpaces(png)) {
try {
byte[] btDataFile = new BASE64Decoder().decodeBuffer(png);
BufferedImage image = ImageIO.read(new ByteArrayInputStream(btDataFile));
label.setIcon(new ImageIcon(image));
}
catch (IOException e) {
LOG.error("Couldn't parse image. " + e.getMessage());
}
}
label.setBackground(IpnbEditorUtil.getBackground());
label.setOpaque(true);
return label;
}
示例2: 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());
}
示例3: addLicenses
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
private static void addLicenses(JPanel panel, Set<License> licenses) {
if (licenses == null) {
return;
}
JPanel licensesPanel = new JBPanel(new HorizontalLayout(1));
licensesPanel.setBackground(UIUtil.getTableBackground());
for (License license : licenses) {
if (CollectionUtils.isEmpty(license.moreInfoUrl)) {
licensesPanel.add(createJTextArea(createLicenseString(license), false));
continue;
}
HyperlinkLabel hyperlinkLabel = new HyperlinkLabel(createLicenseString(license));
hyperlinkLabel.setBackground(UIUtil.getTableBackground());
hyperlinkLabel.setHyperlinkTarget(license.moreInfoUrl.get(0));
licensesPanel.add(hyperlinkLabel);
}
JBLabel headerLabel = new JBLabel("Licenses:");
headerLabel.setBackground(UIUtil.getTableBackground());
headerLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.NORTHWEST;
c.ipadx = 20;
c.ipady = 3;
c.gridy = 4;
panel.add(headerLabel, c);
c.gridx = 1;
c.weightx = 0.9;
panel.add(licensesPanel, c);
}
示例4: createTagLabel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
private static JLabel createTagLabel(String tagText) {
Border emptyBorder = JBUI.Borders.empty(3, 5);
JBLabel label = new JBLabel(tagText);
label.setOpaque(true);
label.setBorder(emptyBorder);
label.setBackground(new JBColor(COLOR, COLOR));
return label;
}
示例5: setWarning
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
public void setWarning(@NotNull String text) {
JBLabel label = new JBLabel(text, UIUtil.getBalloonWarningIcon(), SwingConstants.CENTER);
label.setOpaque(true);
Color color = HintUtil.INFORMATION_COLOR;
label.setBackground(color);
label.setBorder(BorderFactory.createLineBorder(color, 3));
myHeaderPanel.add(label, BorderLayout.SOUTH);
}
示例6: createViewPanel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JBLabel createViewPanel() {
final JBLabel label = new JBLabel(renderCellText());
label.setBackground(IpnbEditorUtil.getBackground());
label.setOpaque(true);
return label;
}
示例7: createViewPanel
import com.intellij.ui.components.JBLabel; //導入方法依賴的package包/類
@Override
protected JComponent createViewPanel() {
final StringBuilder text = new StringBuilder("<html>");
for (String html : myCell.getHtmls()) {
html = html.replace("\"", "'");
text.append(html);
}
text.append("</html>");
final JBLabel label = new JBLabel(text.toString());
label.setBackground(IpnbEditorUtil.getBackground());
label.setOpaque(true);
return label;
}
示例8: 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;
}
示例9: 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;
}