本文整理了Java中javax.swing.JLabel.getBackground()
方法的一些代码示例,展示了JLabel.getBackground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.getBackground()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:getBackground
暂无
代码示例来源:origin: jersey/jersey
private void initAggregators() {
if (twitterCheckbox.isSelected()) {
dataAggregators.add(new TwitterAggregator(colorToString(twitterColorLabel.getBackground())));
}
if (testCheckbox.isSelected()) {
dataAggregators.add(new TestAggregatorJersey(colorToString(testColorLabel.getBackground())));
dataAggregators.add(new TestAggregatorJaxRs(colorToString(testColorLabel.getBackground())));
}
}
代码示例来源:origin: zzz40500/GsonFormat
private void initGeneratePanel(PsiFile file) {
generateClassTF.setBackground(errorLB.getBackground());
currentClass = ((PsiJavaFileImpl) file).getPackageName() + "." + file.getName().split("\\.")[0];
generateClassLB.setText(currentClass);
代码示例来源:origin: magefree/mage
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
JLabel defaultLabel = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
defaultLabel.setHorizontalAlignment(JLabel.CENTER);
// colors
String val = (String) value;
String[] valsList = val.split("/");
if (valsList.length == 2 && !valsList[0].equals(valsList[1])) {
// green draw
Color defaultBack = defaultLabel.getBackground();
greenLabel.setText(val);
greenLabel.setHorizontalAlignment(JLabel.CENTER);
greenLabel.setFont(defaultLabel.getFont());
greenLabel.setForeground(Color.black);
greenLabel.setOpaque(true);
greenLabel.setBackground(new Color(156, 240, 146));
greenLabel.setBorder(new LineBorder(defaultBack, 1));
return greenLabel;
} else {
// default draw
return defaultLabel;
}
}
};
代码示例来源:origin: magefree/mage
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
// get table text cell settings
DefaultTableCellRenderer baseRenderer = (DefaultTableCellRenderer) table.getDefaultRenderer(String.class);
JLabel baseComp = (JLabel) baseRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
String skillCode = baseComp.getText();
// apply settings to render panel from parent
renderPanel.setOpaque(baseComp.isOpaque());
renderPanel.setForeground(CardRendererUtils.copyColor(baseComp.getForeground()));
renderPanel.setBackground(CardRendererUtils.copyColor(baseComp.getBackground()));
renderPanel.setBorder(baseComp.getBorder());
// create each skill symbol as child label
renderPanel.removeAll();
renderPanel.setLayout(new BoxLayout(renderPanel, BoxLayout.X_AXIS));
for (char skillSymbol : skillCode.toCharArray()) {
JLabel symbolLabel = new JLabel();
symbolLabel.setBorder(new EmptyBorder(0, 3, 0, 0));
symbolLabel.setIcon(skillIcon);
renderPanel.add(symbolLabel);
}
return renderPanel;
}
};
代码示例来源:origin: Nilhcem/FakeSMTP
ep.setBackground(label.getBackground());
代码示例来源:origin: RaiMan/SikuliX2
tm.setWrapStyleWord(true);
tm.setEditable(false);
tm.setBackground(new JLabel().getBackground());
JPanel pnl = new JPanel();
pnl.setLayout(new BoxLayout(pnl, BoxLayout.Y_AXIS));
代码示例来源:origin: magefree/mage
renderPanel.setBackground(CardRendererUtils.copyColor(baseComp.getBackground()));
renderPanel.setBorder(baseComp.getBorder());
symbolLabel.setOpaque(baseComp.isOpaque());
symbolLabel.setForeground(baseComp.getForeground());
symbolLabel.setBackground(baseComp.getBackground());
代码示例来源:origin: org.orbisgis/toc
/**
* Gets the start Color for the classification generation
* @return The start Color
*/
public Color getStartColor(){
return startCol.getBackground();
}
代码示例来源:origin: org.orbisgis/toc
/**
* Gets the end Color for the classification generation
* @return The end Color
*/
public Color getEndCol() {
return endCol.getBackground();
}
代码示例来源:origin: otros-systems/otroslogviewer
public JLabelStatusObserver(JLabel label) {
super();
this.label = label;
colorNormal = label.getBackground();
label.setOpaque(true);
}
代码示例来源:origin: net.sf.mmax2/mmax2
public final void clearStatusBar()
{
statusBar.setForeground(statusBar.getBackground());
}
代码示例来源:origin: net.sf.ingenias/editor
@Override
public void mouseEntered(MouseEvent e) {
jl.setOpaque(true);
lastColor=jl.getBackground();
jl.setBackground(Color.lightGray);
}
代码示例来源:origin: stackoverflow.com
@Override
public void mouseClicked(MouseEvent e) {
JLabel clickedPanel = (JLabel) e.getSource();
//Toggle colours
if (clickedPanel.getBackground()==Color.blue)
clickedPanel.setBackground(Color.red);
else
clickedPanel.setBackground(Color.blue);
}
代码示例来源:origin: GoldenGnu/jeveassets
public static JLabel createLabel(final String toolTip, final Icon icon) {
JLabel jLabel = new JLabel();
jLabel.setIcon(icon);
jLabel.setForeground(jLabel.getBackground().darker().darker().darker());
jLabel.setToolTipText(toolTip);
jLabel.setHorizontalAlignment(JLabel.LEFT);
return jLabel;
}
private void addSpace(final int width) {
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = BACKGROUND_JSDOC)
@Override
public Color getBackground() {
return super.getBackground();
}
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public Color getBackground()
{
if((delegate_==this)||(delegate_==null))
return super.getBackground();
return delegate_.getBackground();
}
代码示例来源:origin: MarginallyClever/Makelangelo-software
@Override
public void actionPerformed(ActionEvent e) {
Color c = JColorChooser.showDialog(parent, label.getText(), fieldValue.getBackground());
fieldValue.setBackground(c);
}
代码示例来源:origin: GoldenGnu/jeveassets
public static JLabel createIcon(final Icon icon, final String toolTip) {
JLabel jLabel = new JLabel();
jLabel.setIcon(icon);
jLabel.setForeground(jLabel.getBackground().darker().darker().darker());
jLabel.setMinimumSize(new Dimension(25, 25));
jLabel.setPreferredSize(new Dimension(25, 25));
jLabel.setMaximumSize(new Dimension(25, 25));
jLabel.setHorizontalAlignment(JLabel.CENTER);
jLabel.setToolTipText(toolTip);
return jLabel;
}
public static JLabel createLabel(final String toolTip, final Icon icon) {
代码示例来源:origin: stackoverflow.com
JLabel label = ....;
Timeline timeline = new Timeline(label);
timeline.addPropertyToInterpolate("background", label.getBackground(),
new Color(label.getBackground().getRGB(), true));
timeline.addPropertyToInterpolate("foreground", label.getForeground(),
new Color(label.getForeground().getRGB(), true));
timeline.play();
代码示例来源:origin: chatty/chatty
public WrapLabel() {
setWrapStyleWord(true);
setLineWrap(true);
setBackground(LABEL.getBackground());
setFont(LABEL.getFont());
setBorder(LABEL.getBorder());
setFocusable(false);
setForeground(LABEL.getForeground());
setOpaque(false);
System.out.println(getColumns());
setRows(1);
setColumns(20);
}
内容来源于网络,如有侵权,请联系作者删除!