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


Java JBLabel.setBackground方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:IpnbImagePanel.java

示例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());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ConfigureDeviceOptionsStep.java

示例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);
}
 
開發者ID:JFrogDev,項目名稱:jfrog-idea-plugin,代碼行數:35,代碼來源:DetailsViewFactory.java

示例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;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:9,代碼來源:EduCoursesPanel.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AbstractPopup.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:IpnbHeadingPanel.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:IpnbHtmlPanel.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:DeviceDefinitionList.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:AvdDisplayList.java


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