本文整理了Java中javax.swing.JPanel.setForeground()
方法的一些代码示例,展示了JPanel.setForeground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPanel.setForeground()
方法的具体详情如下:
包路径:javax.swing.JPanel
类名称:JPanel
方法名:setForeground
暂无
代码示例来源:origin: runelite/runelite
@Override
public void setForeground(Color color)
{
undimmedForeground = color;
dimmedForeground = color.darker();
super.setForeground(color);
}
代码示例来源:origin: libgdx/libgdx
private void uiStyle () {
contentPane.setBackground(new Color(36, 36, 36));
topPanel.setBackground(new Color(36, 36, 36));
topPanel.setForeground(new Color(255, 255, 255));
table.setBackground(new Color(46, 46, 46));
table.setForeground(new Color(255, 255, 255));
bottomPanel.setBackground(new Color(36, 36, 36));
bottomPanel.setForeground(new Color(255, 255, 255));
buttonPanel.setBackground(new Color(36, 36, 36));
buttonPanel.setForeground(new Color(255, 255, 255));
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.setBackground(new Color(36, 36, 36));
scrollPane.getViewport().setBackground(new Color(36, 36, 36));
warningNotice.setForeground(new Color(255, 20, 20));
warningNotice2.setForeground(new Color(255, 20, 20));
}
代码示例来源:origin: runelite/runelite
/**
* Dimming sets all parts of this component with darker colors except for the central label
* This is useful for showing that progress is paused
* Setting dim to false will restore the original colors from before the component was dimmed.
* @param dimmed
*/
public void setDimmed(boolean dimmed)
{
this.dimmed = dimmed;
if (dimmed)
{
super.setBackground(dimmedBackground);
super.setForeground(dimmedForeground);
}
else
{
super.setBackground(undimmedBackground);
super.setForeground(undimmedForeground);
}
}
}
代码示例来源:origin: libgdx/libgdx
private void uiStyle () {
content.setBackground(new Color(36, 36, 36));
content.setForeground(new Color(255, 255, 255));
bottomPanel.setBackground(new Color(36, 36, 36));
bottomPanel.setForeground(new Color(255, 255, 255));
buttonPanel.setBackground(new Color(36, 36, 36));
buttonPanel.setForeground(new Color(255, 255, 255));
linkText.setForeground(new Color(20, 150, 20));
contentPane.setBackground(new Color(36, 36, 36));
Border line = BorderFactory.createLineBorder(new Color(80, 80, 80));
Border empty = new EmptyBorder(4, 4, 4, 4);
CompoundBorder border = new CompoundBorder(line, empty);
mavenTextField.setBorder(border);
mavenTextField.setCaretColor(new Color(255, 255, 255));
mavenTextField.setBackground(new Color(46, 46, 46));
mavenTextField.setForeground(new Color(255, 255, 255));
}
代码示例来源:origin: runelite/runelite
@Override
public void setForeground(Color color)
{
super.setForeground(color);
setBackground(color.darker());
}
代码示例来源:origin: stanfordnlp/CoreNLP
treeContainer.setForeground(new java.awt.Color(0, 0, 0));
treeContainer.setPreferredSize(new java.awt.Dimension(200, 200));
treePanel = new TreeJPanel();
代码示例来源: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: magefree/mage
renderPanel.setForeground(CardRendererUtils.copyColor(baseComp.getForeground()));
renderPanel.setBackground(CardRendererUtils.copyColor(baseComp.getBackground()));
renderPanel.setBorder(baseComp.getBorder());
代码示例来源:origin: dboissier/mongo4idea
private void applyUIStyle() {
JXMonthView monthView = getMonthView();
monthView.setMonthStringBackground(backgroundColor);
monthView.setMonthStringForeground(monthForegroundColor);
monthView.setSelectionBackground(selectionBackgroundColor);
monthView.setSelectionForeground(selectionForegroundColor);
monthView.setDaysOfTheWeekForeground(dayOfTheWeekForegroundColor);
monthView.setBackground(backgroundColor);
monthView.setForeground(foregroundColor);
monthView.setTodayBackground(todayBackgroundColor);
getLinkPanel().setBackground(backgroundColor);
getLinkPanel().setForeground(foregroundColor);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-dlight-visualizers
/**
* Overrides <code>JComponent.setForeground</code> to assign
* the unselected-foreground color to the specified color.
*
* @param c set the foreground color to this value
*/
@Override
public void setForeground(Color c) {
super.setForeground(c);
unselectedForeground = c;
}
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
public void configurarCores() {
abaContainer.setBackground(ColorController.COR_CONSOLE);
abaContainer.setForeground(ColorController.COR_LETRA);
cabecalhosContainer.setBackground(ColorController.COR_PRINCIPAL);
cabecalhosContainer.setForeground(ColorController.COR_LETRA);
espacador.setBackground(ColorController.COR_PRINCIPAL);
espacador.setForeground(ColorController.COR_LETRA);
}
/**
代码示例来源:origin: igvteam/igv
@Override
public void setForeground(Color value) {
super.setForeground(value);
if (jCheckBox1 != null) {
jCheckBox1.setForeground(value);
}
}
代码示例来源:origin: com.jidesoft/jide-oss
private void clearAttribute() {
super.setFont(null);
super.setBackground(null);
super.setForeground(null);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setForeground(Color aValue) {
super.setForeground(aValue);
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setForeground(Color aValue) {
super.setForeground(aValue);
}
代码示例来源:origin: stackoverflow.com
JLabel label= new JLabel( "hello" );
label.setForeground( null );
label.setFont( null );
JTextField textField = new JTextField(10);
textField.setForeground( null );
textField.setFont( null );
JPanel panel = new JPanel();
panel.setForeground( Color.RED );
panel.setFont( new Font("monospaced", Font.PLAIN, 24) );
panel.add( label );
panel.add( textField );
代码示例来源:origin: UNIVALI-LITE/Portugol-Studio
@Override
public void configurarCores() {
getEspacador().setBackground(ColorController.FUNDO_ESCURO);
getEspacador().setForeground(ColorController.COR_LETRA);
getEspacador().setPreferredSize(new Dimension(130, 30));
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction
@Override
public void setForeground(Color aValue) {
super.setForeground(aValue);
applyForeground();
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public void setForeground(Color col) {
super.setForeground(col);
Component[] c = getComponents();
for (int i = 0; i < c.length; i++) {
c[i].setForeground(col);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
public void setForeground(Color col) {
super.setForeground(col);
Component[] c = getComponents();
for (int i=0; i < c.length; i++) {
c[i].setForeground(col);
}
}
内容来源于网络,如有侵权,请联系作者删除!