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

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

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

Box.setAlignmentX介绍

暂无

代码示例

代码示例来源:origin: skylot/jadx

box.setAlignmentX(LEFT_ALIGNMENT);
box.add(searchInPanel);
box.add(searchOptions);

代码示例来源:origin: apache/pdfbox

box.add(flagValueLabel);
box.add(scrollPane);
box.setAlignmentX(Component.LEFT_ALIGNMENT);

代码示例来源:origin: apache/pdfbox

box.add(colorCountLabel);
box.add(scrollPane);
box.setAlignmentX(Component.LEFT_ALIGNMENT);

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

buttons.setAlignmentX(Component.LEFT_ALIGNMENT);

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

/* package */ static JComponent buildHelp(String resource) {
  Box help = new Box(BoxLayout.Y_AXIS);
  //help.setBorder(ComponentFactory.createTitledBorder("Description"));
  help.setAlignmentX(0.0f);
  
  try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        PrecomputePreferencesPanel.class.getResourceAsStream(resource)));
    String line;
    while ((line = reader.readLine()) != null) {
      help.add(new JLabel(line));
    }
    return help;
  }
  catch (Throwable t) {
    LoggerFactory.getLogger(PrecomputePreferencesPanel.class).error("Error building PrecomputePreferencesPanel help for resource: {}", resource);
    return null;
  }
}

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

/* package */ static JComponent buildHelp(String resource) {
  Box help = new Box(BoxLayout.Y_AXIS);
  //help.setBorder(ComponentFactory.createTitledBorder("Description"));
  help.setAlignmentX(0.0f);
  
  try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        PrecomputePreferencesPanel.class.getResourceAsStream(resource)));
    String line;
    while ((line = reader.readLine()) != null) {
      help.add(new JLabel(line));
    }
    return help;
  }
  catch (Throwable t) {
    LoggerFactory.getLogger(PrecomputePreferencesPanel.class).error("Error building PrecomputePreferencesPanel help for resource: {}", resource);
    return null;
  }
}

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

/* package */ static JComponent buildHelp(String resource) {
  Box help = new Box(BoxLayout.Y_AXIS);
  //help.setBorder(ComponentFactory.createTitledBorder("Description"));
  help.setAlignmentX(0.0f);
  
  try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        PrecomputePreferencesPanel.class.getResourceAsStream(resource)));
    String line;
    while ((line = reader.readLine()) != null) {
      help.add(new JLabel(line));
    }
    return help;
  }
  catch (Throwable t) {
    ProtegeApplication.getErrorLog().logError(t);
    return null;
  }
}

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

/* package */ static JComponent buildHelp(String resource) {
  Box help = new Box(BoxLayout.Y_AXIS);
  //help.setBorder(ComponentFactory.createTitledBorder("Description"));
  help.setAlignmentX(0.0f);
  
  try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        PrecomputePreferencesPanel.class.getResourceAsStream(resource)));
    String line;
    while ((line = reader.readLine()) != null) {
      help.add(new JLabel(line));
    }
    return help;
  }
  catch (Throwable t) {
    ProtegeApplication.getErrorLog().logError(t);
    return null;
  }
}

代码示例来源:origin: chungkwong/MathOCR

private void addStringProperty(String com){
  Box box=Box.createHorizontalBox();
  box.add(new JLabel(ENVIRONMENT.getTranslation(com)));
  JTextField field=new JTextField(ENVIRONMENT.getString(com));
  field.setToolTipText(ENVIRONMENT.getTranslation(com+"_TIPS"));
  field.setActionCommand(com);
  field.addActionListener(this);
  box.add(field);
  box.setAlignmentX(0);
  add(box);
}
public void actionPerformed(ActionEvent e){

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

private JPanel createSettingsPanel(ArrayList<ArrayList<Component>> comps) {
  JPanel panel = new JPanel();
  panel.setLayout(new BorderLayout());
  Box innerpanel = new Box(BoxLayout.PAGE_AXIS);
  for (ArrayList<Component> cs : comps) {
    Box subPanel = new Box(BoxLayout.LINE_AXIS);
    for (Component c : cs) {
      if (c instanceof JLabel) {
        subPanel.add(Box.createRigidArea(LABEL_SPACER));
        subPanel.add(c);
        subPanel.add(Box.createRigidArea(LABEL_SPACER));
      } else {
        subPanel.add(c);    
      }
    }
    subPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    innerpanel.add(subPanel);
  }
  innerpanel.add(Box.createVerticalGlue());
  innerpanel.setBorder(new EmptyBorder(10,10,10,10));
  panel.add(innerpanel,BorderLayout.PAGE_START);
  return panel;
}

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

public CreateDefinedClassPanel(OWLEditorKit eKit) {
  setLayout(new BorderLayout());
  anonymousButton = new JRadioButton("Anonymous class", true);
  anonymousButton.setAlignmentX(0.0f);
  namedButton = new JRadioButton("Named class", !anonymousButton.isSelected());
  namedButton.setAlignmentY(0.0f);
  anonymousButton.addActionListener(buttonListener);
  namedButton.addActionListener(buttonListener);
  entityCreatePanel = new OWLEntityCreationPanel<OWLClass>(eKit, null, OWLClass.class);
  entityCreatePanel.setEnabled(namedButton.isSelected());
  entityCreatePanel.setAlignmentY(0.0f);
  entityCreatePanel.setBorder(new EmptyBorder(0, 20, 0, 0));
  Box namedPanel = new Box(BoxLayout.LINE_AXIS);
  namedPanel.setAlignmentX(0.0f);
  namedPanel.add(namedButton);
  namedPanel.add(entityCreatePanel);
  ButtonGroup bg = new ButtonGroup();
  bg.add(namedButton);
  bg.add(anonymousButton);
  Box box = new Box(BoxLayout.PAGE_AXIS);
  box.add(anonymousButton);
  box.add(namedPanel);
  add(box, BorderLayout.CENTER);
}

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

public CreateDefinedClassPanel(OWLEditorKit eKit) {
  setLayout(new BorderLayout());
  anonymousButton = new JRadioButton("Anonymous class", true);
  anonymousButton.setAlignmentX(0.0f);
  namedButton = new JRadioButton("Named class", !anonymousButton.isSelected());
  namedButton.setAlignmentY(0.0f);
  anonymousButton.addActionListener(buttonListener);
  namedButton.addActionListener(buttonListener);
  entityCreatePanel = new OWLEntityCreationPanel<OWLClass>(eKit, null, OWLClass.class);
  entityCreatePanel.setEnabled(namedButton.isSelected());
  entityCreatePanel.setAlignmentY(0.0f);
  entityCreatePanel.setBorder(new EmptyBorder(0, 20, 0, 0));
  Box namedPanel = new Box(BoxLayout.LINE_AXIS);
  namedPanel.setAlignmentX(0.0f);
  namedPanel.add(namedButton);
  namedPanel.add(entityCreatePanel);
  ButtonGroup bg = new ButtonGroup();
  bg.add(namedButton);
  bg.add(anonymousButton);
  Box box = new Box(BoxLayout.PAGE_AXIS);
  box.add(anonymousButton);
  box.add(namedPanel);
  add(box, BorderLayout.CENTER);
}

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

if (plugins.size() > 1) {
  Box optBox = new Box(BoxLayout.Y_AXIS);
  optBox.setAlignmentX(0.0f);
  optBox.setBorder(ComponentFactory.createTitledBorder("Explanation Plugins"));
  ButtonGroup group = new ButtonGroup();

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

optBox.setAlignmentX(0.0f);
optBox.setBorder(ComponentFactory.createTitledBorder("Appearance"));
optBox.add(highlightAOStatementsCheckBox);

代码示例来源:origin: chungkwong/MathOCR

private void addIntegerProperty(String com){
  Box box=Box.createHorizontalBox();
  box.add(new JLabel(ENVIRONMENT.getTranslation(com)));
  JFormattedTextField field=new JFormattedTextField(ENVIRONMENT.getInteger(com));
  field.setToolTipText(ENVIRONMENT.getTranslation(com+"_TIPS"));
  field.setActionCommand(com);
  field.addActionListener(this);
  box.add(field);
  box.setAlignmentX(0);
  add(box);
}
private void addFloatProperty(String com){

代码示例来源:origin: com.sikulix/sikulixapi

buttons.setAlignmentX(Component.LEFT_ALIGNMENT);

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

namedPanel.setAlignmentX(0.0f);
namedPanel.add(namedButton);
namedPanel.add(entityCreatePanel);

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

private Component createAutoUpdatePanel() {
  Box box = new Box(BoxLayout.Y_AXIS);
  box.setAlignmentX(0.0f);
  box.setBorder(ComponentFactory.createTitledBorder("Auto update"));
  checkForUpdatesAtStartupCheckBox = new JCheckBox("Automatically check for plugin updates at start up",
                           PluginManager.getInstance().isAutoUpdateEnabled());
  checkForUpdatesAtStartupCheckBox.setAlignmentX(0.0f);
  JButton checkForUpdatesNow = new JButton(new AbstractAction("Check for updates now") {
    /**
     * 
     */
    private static final long serialVersionUID = -1489049180196552810L;
    public void actionPerformed(ActionEvent e) {
      PluginManager.getInstance().checkForUpdates();
    }
  });
  checkForUpdatesNow.setAlignmentX(0.0f);
  box.add(checkForUpdatesAtStartupCheckBox);
  box.add(Box.createVerticalStrut(12));
  box.add(checkForUpdatesNow);
  return box;
}

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

private Component createAutoUpdatePanel() {
  Box box = new Box(BoxLayout.Y_AXIS);
  box.setAlignmentX(0.0f);
  box.setBorder(ComponentFactory.createTitledBorder("Auto update"));
  checkForUpdatesAtStartupCheckBox = new JCheckBox("Automatically check for plugin updates at start up",
                           PluginManager.getInstance().isAutoUpdateEnabled());
  checkForUpdatesAtStartupCheckBox.setAlignmentX(0.0f);
  JButton checkForUpdatesNow = new JButton(new AbstractAction("Check for updates now") {
    /**
     * 
     */
    private static final long serialVersionUID = -1489049180196552810L;
    public void actionPerformed(ActionEvent e) {
      PluginManager.getInstance().checkForUpdates();
    }
  });
  checkForUpdatesNow.setAlignmentX(0.0f);
  box.add(checkForUpdatesAtStartupCheckBox);
  box.add(Box.createVerticalStrut(12));
  box.add(checkForUpdatesNow);
  return box;
}

代码示例来源:origin: chungkwong/MathOCR

private void addFloatProperty(String com){
  Box box=Box.createHorizontalBox();
  box.add(new JLabel(ENVIRONMENT.getTranslation(com)));
  JFormattedTextField field=new JFormattedTextField(ENVIRONMENT.getFloat(com));
  field.setToolTipText(ENVIRONMENT.getTranslation(com+"_TIPS"));
  field.setActionCommand(com);
  field.addActionListener(this);
  box.add(field);
  box.setAlignmentX(0);
  add(box);
}
private void addStringProperty(String com){

相关文章