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

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

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

Box.<init>介绍

暂无

代码示例

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

var blueBox = new Box("blue");
alert(blueBox.getColor()); // will alert blue

var greenBox = new Box("green");
alert(greenBox.getColor()); // will alert green

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

var b = new Box();

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

var b = new Box();

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

Box rawBox = new Box();           // rawBox is a raw type of Box<T>
Box<Integer> intBox = rawBox;     // warning: unchecked conversion

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

public class WarningDemo {
  public static void main(String[] args){
    Box<Integer> bi;
    bi = createBox();
  }

  static Box createBox(){
    return new Box();
  }
}

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

private void initComponents() {
  JPanel buttonPanel = new JPanel();
  Box buttonBox = new Box(BoxLayout.X_AXIS);
  cardPanel = new JPanel();
  cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
  cardLayout = new CardLayout();
  cardPanel.setLayout(cardLayout);
  backButton = new JButton("Back");
  nextButton = new JButton("Next");
  finishButton = new JButton("Finish");
  cancelButton = new JButton("Cancel");
  backButton.addActionListener(controller);
  nextButton.addActionListener(controller);
  finishButton.addActionListener(controller);
  cancelButton.addActionListener(controller);
  buttonPanel.setLayout(new BorderLayout());
  buttonPanel.add(new JSeparator(), BorderLayout.NORTH);
  buttonBox.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
  buttonBox.add(backButton);
  buttonBox.add(Box.createHorizontalStrut(10));
  buttonBox.add(nextButton);
  buttonBox.add(Box.createHorizontalStrut(30));
  buttonBox.add(finishButton);
  buttonBox.add(Box.createHorizontalStrut(10));
  buttonBox.add(cancelButton);
  buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST);
  getContentPane().add(buttonPanel, java.awt.BorderLayout.SOUTH);
  getContentPane().add(new JScrollPane(cardPanel), java.awt.BorderLayout.CENTER);
}

代码示例来源:origin: RaiMan/SikuliX2

titleBar.setVisible(false);
buttons = new Box(BoxLayout.X_AXIS);
defaultButton = new Button("Close");
buttons.add(defaultButton);

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

final Box box = new Box(BOX_EDGE_LENGTH, BOX_EDGE_LENGTH, BOX_EDGE_LENGTH);
box.setTranslateX(SCENE_SIZE / 2d);
box.setTranslateY(SCENE_SIZE / 2d);

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

Box box = new Box(BoxLayout.Y_AXIS);
box.setAlignmentX(JComponent.CENTER_ALIGNMENT);
box.add(Box.createVerticalGlue());

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

class BigBox{
  Box B1=new Box(20,30,40); 
  {
    B1.length=30;
  }
}

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

private Component createAuthorPanel() {
  Box box = new Box(BoxLayout.LINE_AXIS);
  final JLabel label = new JLabel("Author: ");
  final Font font = label.getFont().deriveFont(Font.BOLD);
  label.setFont(font);
  label.setAlignmentX(0.0f);
  box.add(label);
  authorLabel.setFont(font);
  box.add(authorLabel);
  box.add(Box.createHorizontalGlue());
  return box;
}

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

public class WarningDemo {
  public static void main(String[] args) {
    Box<Integer> bi;
    bi = createBox();
  }

  static Box createBox() {
    return new Box();
  }
}

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

// I assumed you have a LinearLayout to which you want to add your Box
LinearLayout parent = (LinearLayout) findViewById(R.id.parent_id);
//create the Box and added to the parent above
Box theBox = new Box(this); // if you are in an Activity
//some LayoutParams to replicate your xml attributes
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
// set the Orientation for the Box
theBox.setOrientation(LinearLayout.HORIZONTAL);
//add the Box
parent.addView(theBox);

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

private Box createInfoPanel()
{
  final Box pnl = new Box(BoxLayout.X_AXIS);
  pnl.add(new MultipleLineLabel(i18n.INSTRUCTIONS));
  return pnl;
}

代码示例来源:origin: org.nuiton.jaxx/jaxx-runtime-swing-widget

protected void createBox() {
  box =  new javax.swing.Box(0);
  $objectMap.put("box", box);
  box.setName("box");
}

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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  setInstructions("Please decide which asserted information you wish to include in the export.  If you choose " + "to include asserted logical axioms then all logical axioms in the ontology will be exported as well " + "as the inferred logical axioms that were selected on the previous page.");
  includeAnnotationsCheckBox = new JCheckBox("Include annotations");
  includeAssertedLogicalAxiomsCheckBox = new JCheckBox("Include asserted logical axioms");
  Box box = new Box(BoxLayout.Y_AXIS);
  box.add(includeAnnotationsCheckBox);
  box.add(Box.createVerticalStrut(4));
  box.add(includeAssertedLogicalAxiomsCheckBox);
  parent.add(box, BorderLayout.NORTH);
}

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

@Override
protected void createUI(JComponent parent) {
  setInstructions("Please choose a value for the imported location:");
  parent.setLayout(new BorderLayout());
  mainBox = new Box(BoxLayout.Y_AXIS);
  parent.add(mainBox, BorderLayout.CENTER);
}

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

private Component createInfoBox() {
  Box infoBox = new Box(BoxLayout.PAGE_AXIS);
  infoBox.add(Box.createRigidArea(new Dimension(0, 7)));
  infoBox.add(createAuthorPanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 7)));
  infoBox.add(createLicensePanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 7)));
  infoBox.add(createDocPanel());
  return infoBox;
}

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

@Override
public void initialiseIndividualsView() throws Exception {
  super.initialiseIndividualsView();
  getOWLWorkspace().getOWLSelectionModel().addListener(l);
  JComponent typePanel = new Box(BoxLayout.X_AXIS);
  typePanel.add(new JLabel("For: "));
  typePanel.add(typeLabel);
  typePanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 0));
  add(typePanel, BorderLayout.NORTH);
}

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

private Component createInfoBox() {
  Box infoBox = new Box(BoxLayout.PAGE_AXIS);
  infoBox.setBorder(ComponentFactory.createTitledBorder("Plugin info"));
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createAuthorPanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 10)));
  infoBox.add(createLicensePanel());
  infoBox.add(Box.createRigidArea(new Dimension(0, 20)));
  infoBox.add(createDocPanel());
  return infoBox;
}

相关文章