javax.swing.JButton.add()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(113)

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

JButton.add介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

public static JXPanel getDescription(CardView card, int width, int height) {
  JXPanel descriptionPanel = new JXPanel();
  //descriptionPanel.setAlpha(.8f);
  descriptionPanel.setBounds(0, 0, width, height);
  descriptionPanel.setVisible(false);
  descriptionPanel.setLayout(null);
  //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green));
  JButton j = new JButton("");
  j.setBounds(0, 0, width, height);
  j.setBackground(Color.black);
  j.setLayout(null);
  JLabel cardText = new JLabel();
  cardText.setBounds(5, 5, width - 10, height - 10);
  cardText.setForeground(Color.white);
  cardText.setFont(cardNameFont);
  cardText.setVerticalAlignment(SwingConstants.TOP);
  j.add(cardText);
  TextLines textLines = GuiDisplayUtil.getTextLinesfromCardView(card);
  cardText.setText(getRulefromCardView(card, textLines).toString());
  descriptionPanel.add(j);
  return descriptionPanel;
}

代码示例来源:origin: com.googlecode.gstreamer-java/gstreamer-java

JButton button = new JButton(file.getName());
button.setLayout(new BoxLayout(button, BoxLayout.Y_AXIS));
button.add(player);
box.add(label, BorderLayout.SOUTH);
box.setOpaque(false);
button.add(box);
panel.add(button);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

pluginBut = new JButton("Launchers...");
final JButton copyB = pluginBut;
copyB.add(pluginPopup);
pluginBut.addActionListener(new ActionListener() {
 @Override

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

JLabel iconLabel = new JLabel( "\uf0a8" );
 iconLabel.setFont( fontAwesome );
 JButton iconButton = new JButton( );
 iconButton.add( iconLabel );

代码示例来源:origin: Waikato/weka-trunk

pluginBut = new JButton("Launchers...");
final JButton copyB = pluginBut;
copyB.add(pluginPopup);
pluginBut.addActionListener(new ActionListener() {
 @Override

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

JButton btn = new JButton();
btn.add(new JLabel(text));
btn.add(new JLabel(img));
btn.setLayout(/*best layout choice here*/);
btn.setPreferredSize(new Dimension(x,y));
btn.setMaximumSize(new Dimension(maxX, minY));
btn.setMinimumSize(new Dimension(minX, minY)); //this one is most important when it comes to layoutmanagers

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

pluginBut = new JButton("Launchers...");
final JButton copyB = pluginBut;
copyB.add(pluginPopup);
pluginBut.addActionListener(new ActionListener() {
 @Override

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

JButton j1=new JButton("a");
j1.setLayout(null);
j1.setBackground(Color.red);
JButton j2=new JButton("b");
j2.setBackground(Color.yellow);
j2.setBounds(100, 100, 50, 50);
j1.add(j2);
add(j1);

代码示例来源:origin: Waikato/weka-trunk

pluginBut = new JButton("Launchers...");
final JButton copyB = pluginBut;
copyB.add(pluginPopup);
pluginBut.addActionListener(new ActionListener() {
 @Override

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

m_templatesB.add(templatesMenu);
templatesMenu.show(m_templatesB, 0, 0);

代码示例来源:origin: Waikato/weka-trunk

m_templatesB.add(templatesMenu);
templatesMenu.show(m_templatesB, 0, 0);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

popupMenu.add(menuItem);
templatesB.add(popupMenu);
popupMenu.show(templatesB, 0, 0);

代码示例来源:origin: Waikato/weka-trunk

popupMenu.add(menuItem);
templatesB.add(popupMenu);
popupMenu.show(templatesB, 0, 0);

相关文章

微信公众号

最新文章

更多

JButton类方法