javax.swing.JComponent.setLayout()方法的使用及代码示例

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

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

JComponent.setLayout介绍

暂无

代码示例

代码示例来源:origin: JetBrains/ideavim

/**
 * Turns off the ex entry field and optionally puts the focus back to the original component
 */
public void deactivate(boolean refocusOwningEditor) {
 if (!myActive) return;
 myActive = false;
 myText.setText("");
 if (refocusOwningEditor) {
  UiHelper.requestFocus(myEditor.getContentComponent());
 }
 if (myOldGlass != null) {
  myOldGlass.removeComponentListener(myAdapter);
  myOldGlass.setVisible(false);
  myOldGlass.remove(this);
  myOldGlass.setOpaque(myWasOpaque);
  myOldGlass.setLayout(myOldLayout);
 }
}

代码示例来源:origin: JetBrains/ideavim

/**
 * Turns on the more window for the given editor
 */
private void activate() {
 JRootPane root = SwingUtilities.getRootPane(myEditor.getContentComponent());
 myOldGlass = (JComponent)root.getGlassPane();
 if (myOldGlass != null) {
  myOldLayout = myOldGlass.getLayout();
  myWasOpaque = myOldGlass.isOpaque();
  myOldGlass.setLayout(null);
  myOldGlass.setOpaque(false);
  myOldGlass.add(this);
  myOldGlass.addComponentListener(myAdapter);
 }
 setFontForElements();
 positionPanel();
 if (myOldGlass != null) {
  myOldGlass.setVisible(true);
 }
 myActive = true;
 UiHelper.requestFocus(myText);
}

代码示例来源:origin: JetBrains/ideavim

oldLayout = oldGlass.getLayout();
wasOpaque = oldGlass.isOpaque();
oldGlass.setLayout(null);
oldGlass.setOpaque(false);
oldGlass.add(this);

代码示例来源:origin: JetBrains/ideavim

/**
 * Turns off the ex entry field and optionally puts the focus back to the original component
 */
public void deactivate(boolean refocusOwningEditor) {
 logger.info("deactivate");
 if (!active) return;
 active = false;
 if (!ApplicationManager.getApplication().isUnitTestMode()) {
  if (refocusOwningEditor && parent != null) {
   UiHelper.requestFocus(parent);
  }
  oldGlass.removeComponentListener(adapter);
  oldGlass.setVisible(false);
  oldGlass.remove(this);
  oldGlass.setOpaque(wasOpaque);
  oldGlass.setLayout(oldLayout);
  if (isIncSearchEnabled(label.getText())) {
   entry.getDocument().removeDocumentListener(documentListener);
   final Editor editor = entry.getEditor();
   editor.getScrollingModel().scrollVertically(verticalOffset);
   editor.getScrollingModel().scrollHorizontally(horizontalOffset);
   if (incHighlighter != null) {
    editor.getMarkupModel().removeHighlighter(incHighlighter);
   }
  }
 }
 parent = null;
}

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

titleBar.setLayout(new LayoutManager()

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

@Override
public void installUI(JComponent c) {
  super.installUI(c);
  c.setLayout(new BorderLayout());
  c.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  installedComponents.add(c);
}

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

panel.add(description);
panel.add(progressBar);
content.setLayout(new BorderLayout());
content.add(panel, BorderLayout.NORTH);
content.add(cancelBox, BorderLayout.SOUTH);

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

glassPane.setLayout(null);
glassPane.setOpaque(false);
glassPane.setVisible(true);

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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  holder = new JPanel();
  holder.setOpaque(false);
  holder.setLayout(new BoxLayout(holder, BoxLayout.PAGE_AXIS));
  bGroup = new ButtonGroup();
  parent.add(holder, BorderLayout.NORTH);
}

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

protected void createUI(final JComponent parent) {
  JPanel panel = new JPanel(new BorderLayout(7, 7));
  panel.add(new JLabel("Please wait.  Verifying import..."), BorderLayout.NORTH);
  progressBar = new JProgressBar(0, 100);
  progressBar.setIndeterminate(true);
  panel.add(progressBar, BorderLayout.SOUTH);
  parent.setLayout(new BorderLayout());
  parent.add(panel, BorderLayout.NORTH);
}

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

protected void createUI(final JComponent parent) {
  JPanel panel = new JPanel(new BorderLayout(7, 7));
  panel.add(new JLabel("Please wait.  Verifying import..."), BorderLayout.NORTH);
  progressBar = new JProgressBar(0, 100);
  progressBar.setIndeterminate(true);
  panel.add(progressBar, BorderLayout.SOUTH);
  parent.setLayout(new BorderLayout());
  parent.add(panel, BorderLayout.NORTH);
}

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

protected void createUI(JComponent parent) {
  setInstructions("Would you like to copy the file to to root ontology folder? " + "Ontologies are only editable if they are loaded from the same folder that the root importing " + "ontology was loaded from.");
  copyCheckBox = new JCheckBox("Copy to imports root folder", true);
  parent.setLayout(new BorderLayout());
  parent.add(copyCheckBox, BorderLayout.NORTH);
}

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

protected void createUI(JComponent parent) {
  setInstructions("The system will import the following ontologies.  Press Finish " + "to import these ontologies, or Cancel to exit the wizard without importing " + "any ontologies.");
  importedOntologiesComponent = new JPanel(new BorderLayout());
  parent.setLayout(new BorderLayout());
  parent.add(importedOntologiesComponent, 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: edu.stanford.protege/org.protege.editor.owl

@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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  list = new JList();
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  list.setVisibleRowCount(8);
  list.setCellRenderer(getOWLEditorKit().getWorkspace().createOWLCellRenderer());
  final java.util.List<OWLOntology> orderedOntologies = new ArrayList<>(getOWLModelManager().getOntologies());
  Collections.sort(orderedOntologies, getOWLModelManager().getOWLObjectComparator());
  list.setListData(orderedOntologies.toArray());
  parent.add(new JScrollPane(list), BorderLayout.NORTH);
}

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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  list = new JList();
  list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  list.setVisibleRowCount(8);
  list.setCellRenderer(getOWLEditorKit().getWorkspace().createOWLCellRenderer());
  final java.util.List<OWLOntology> orderedOntologies = new ArrayList<OWLOntology>(getOWLModelManager().getOntologies());
  Collections.sort(orderedOntologies, getOWLModelManager().getOWLObjectComparator());
  list.setListData(orderedOntologies.toArray());
  parent.add(new JScrollPane(list), BorderLayout.NORTH);
}

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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  list = new JList();
  list.setVisibleRowCount(8);
  list.setCellRenderer(getOWLEditorKit().getWorkspace().createOWLCellRenderer());
  final java.util.List<OWLOntology> orderedOntologies = new ArrayList<>(getOWLModelManager().getOntologies());
  Collections.sort(orderedOntologies, getOWLModelManager().getOWLObjectComparator());
  list.setListData(orderedOntologies.toArray());
  parent.add(new JScrollPane(list), BorderLayout.NORTH);
}

代码示例来源:origin: com.github.insubstantial/flamingo

@Override
public void uninstallUI(JComponent c) {
  c.setLayout(null);
  uninstallKeyboardActions();
  uninstallListeners();
  uninstallComponents();
  uninstallDefaults();
  this.commandButton = null;
}

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

protected void createUI(JComponent parent) {
  parent.setLayout(new BorderLayout());
  setInstructions("Please select the root class");
  tree = new OWLModelManagerTree<>(getOWLEditorKit(),
                       getOWLModelManager().getOWLHierarchyManager().getOWLClassHierarchyProvider());
  tree.setSelectedOWLObject(getOWLEditorKit().getWorkspace().getOWLSelectionModel().getLastSelectedClass());
  parent.add(ComponentFactory.createScrollPane(tree));
}

相关文章

JComponent类方法