javax.swing.Box.setBackground()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中javax.swing.Box.setBackground()方法的一些代码示例,展示了Box.setBackground()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Box.setBackground()方法的具体详情如下:
包路径:javax.swing.Box
类名称:Box
方法名:setBackground

Box.setBackground介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

main_box.setBackground(Color.white);

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

public VerticalPanel(Color bkg) {
  this();
  subPanel.setBackground(bkg);
  this.setBackground(bkg);
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

public HorizontalPanel(Color bk) {
  this();
  subPanel.setBackground(bk);
  this.setBackground(bk);
}

代码示例来源:origin: stackoverflow.com

setSize(new Dimension(1000, 600));
gameBoard = new JPanel();
gameBoard.setLayout(null);
gameBoard.setOpaque(false);
Dimension expectedDimension = new Dimension(920, 500);
gameBoard.setPreferredSize(expectedDimension);
gameBoard.setMaximumSize(expectedDimension);
gameBoard.setMinimumSize(expectedDimension);
//add cards to gameBoard here

JLabel background = new JLabel( new ImageIcon( getClass().getResource("images/graphic.png") ) );
background.setLocation(79,0); //manually center graphic
background.setBounds(new Rectangle(0, 0, 920, 500));
gameBoard.add(background);

Box centerBox = new Box(BoxLayout.Y_AXIS);
centerBox.setOpaque(true); 
centerBox.setBackground(Color.WHATEVER);
centerBox.add(Box.createVerticalGlue());
centerBox.add(gameBoard);
centerBox.add(Box.createVerticalGlue());
add(centerBox);
setVisible(true);

代码示例来源:origin: eugener/oxbow

commands.add( new JButton( new PopupWindow.CommandAction(bundle.getString("Cancel"))));
commands.setBorder( BorderFactory.createEmptyBorder(3, 0, 3, 0));
commands.setBackground(UIManager.getColor("Panel.background"));
commands.setOpaque(true);

代码示例来源:origin: protegeproject/protege

box.setBackground(Color.WHITE);
JPanel boxHolder = new JPanel(new BorderLayout());
boxHolder.setBorder(ComponentFactory.createTitledBorder("Ontologies"));

代码示例来源:origin: aterai/java-swing-tips

private MainPanel() {
 super(new BorderLayout());
 Box accordion = Box.createVerticalBox();
 accordion.setOpaque(true);
 accordion.setBackground(new Color(180, 180, 255));
 accordion.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 5));
 makeExpansionPanelList().forEach(p -> {
  accordion.add(p);
  accordion.add(Box.createVerticalStrut(5));
 });
 accordion.add(Box.createVerticalGlue());
 JScrollPane scroll = new JScrollPane(accordion);
 scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
 scroll.getVerticalScrollBar().setUnitIncrement(25);
 JSplitPane split = new JSplitPane();
 split.setResizeWeight(.5);
 split.setDividerSize(2);
 split.setLeftComponent(scroll);
 split.setRightComponent(new JLabel("Dummy"));
 add(split);
 setPreferredSize(new Dimension(320, 240));
}

代码示例来源:origin: org.bidib.org.oxbow/swingbits

commands.add( new JButton( new PopupWindow.CommandAction("Cancel")));
commands.setBorder( BorderFactory.createEmptyBorder(3, 0, 3, 0));
commands.setBackground(UIManager.getColor("Panel.background"));
commands.setOpaque(true);

代码示例来源:origin: stackoverflow.com

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
center.setOpaque(true);
center.setBackground(Color.lightGray);
center.add(Box.createVerticalGlue());
center.add(new EdgePanel());

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

box.setBackground(Color.WHITE);
JPanel boxHolder = new JPanel(new BorderLayout());
boxHolder.setBorder(ComponentFactory.createTitledBorder("Ontologies"));

代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl

box.setBackground(Color.WHITE);
JPanel boxHolder = new JPanel(new BorderLayout());
boxHolder.setBorder(ComponentFactory.createTitledBorder("Ontologies"));

代码示例来源:origin: org.protege/protege-editor-owl

box.setBackground(Color.WHITE);
JPanel boxHolder = new JPanel(new BorderLayout());
boxHolder.setBorder(ComponentFactory.createTitledBorder("Ontologies"));

代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets

commands.add(new JButton(new CommandAction(t("jaxx.table.filter.popup.button.cancel"))));
commands.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
commands.setBackground(UIManager.getColor("Panel.background"));
commands.setOpaque(true);

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra

commands.add(new JButton(new CommandAction(t("jaxx.table.filter.popup.button.cancel"))));
commands.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
commands.setBackground(UIManager.getColor("Panel.background"));
commands.setOpaque(true);

代码示例来源:origin: MegaMek/mekhq

rowRibbonsBox.setBackground(Color.RED);

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

main_box.setBackground(Color.white);

代码示例来源:origin: net.sf.mmax2/mmax2

public final void addAttributes(MMAX2Attribute[] attributes)
{        
  Box tempbox = (Box) this.modifiablePanel.getComponent(0);
  Box schemebox = null;
  
  if (tempbox.getComponentCount() !=1)
  {
    schemebox = Box.createVerticalBox();
    schemebox.setBackground(Color.yellow);
    tempbox.add(schemebox);
  }
  else 
  {
    schemebox = (Box) tempbox.getComponent(0);
  }
      
  for (int z=0;z<attributes.length;z++)
  {            
    schemebox.add(attributes[z]);            
  }
  
  rebuild();
  container.invalidate();
}

代码示例来源:origin: apache/activemq-artemis

main_box.setBackground(Color.white);

代码示例来源:origin: biojava/biojava

hBox.setBackground(Color.white);
hBox.add(Box.createHorizontalGlue());
hBox.add(residueSizeSlider);

代码示例来源:origin: net.sf.mmax2/mmax2

schemebox.setBackground(Color.yellow);
tempbox.add(schemebox);

相关文章