javax.swing.JScrollPane.getComponent()方法的使用及代码示例

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

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

JScrollPane.getComponent介绍

暂无

代码示例

代码示例来源:origin: com.github.jjYBdx4IL/github-test-utils

/**
   * @return the container
   */
  public JPanel getContainer() {
    return (JPanel) ((JViewport) ((JScrollPane) jf.getContentPane().getComponent(0)).getComponent(0)).getComponent(0);
  }
}

代码示例来源:origin: com.github.jjYBdx4IL.utils/junit4-utils

/**
   * @return the container
   */
  public JPanel getContainer() {
    return (JPanel) ((JViewport) ((JScrollPane) jf.getContentPane().getComponent(0)).getComponent(0)).getComponent(0);
  }
}

代码示例来源:origin: datacleaner/DataCleaner

private void setFilePaneBackground(final Container container, final Color bg) {
  final Component[] children = container.getComponents();
  for (final Component component : children) {
    if (component instanceof JScrollPane) {
      // the "file pane" (the component containing the list of files)
      // is placed inside a JScrollPane
      final JScrollPane scroll = (JScrollPane) component;
      setContainerBackground(scroll.getComponent(0), bg);
    } else if (component instanceof Container) {
      setFilePaneBackground((Container) component, bg);
    }
  }
}

代码示例来源:origin: senbox-org/s2tbx

private void insertMessageLabel(JScrollPane parent) {
  if (parent != null) {
    this.messagePanel = new JPanel();
    this.messagePanel.add(new JLabel(TangoIcons.status_dialog_information(TangoIcons.Res.R16)));
    this.messageLabel = new JLabel(resampleMessage);
    this.messageLabel.setForeground(Color.BLUE);
    this.messagePanel.add(messageLabel);
    this.messagePanel.setVisible(false);
    JViewport viewport = (JViewport) parent.getComponent(0);
    JPanel initial = (JPanel) viewport.getComponent(0);
    Dimension preferredSize = initial.getPreferredSize();
    JPanel wrapper = new JPanel(new BorderLayout());
    wrapper.add(initial, BorderLayout.NORTH);
    wrapper.add(this.messagePanel, BorderLayout.SOUTH);
    this.messagePanel.setVisible(false);
    wrapper.setPreferredSize(new Dimension(preferredSize.width, preferredSize.height + 30));
    viewport.remove(initial);
    viewport.add(wrapper);
  }
}

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

/**
 * returns the table of the current tab, can be NULL
 * 
 * @return the currently selected table
 */
protected ResultSetTable getCurrentTable() {
 ResultSetTable table;
 JScrollPane pane;
 JViewport port;
 int index;
 table = null;
 index = m_TabbedPane.getSelectedIndex();
 if (index > -1) {
  pane = (JScrollPane) m_TabbedPane.getComponentAt(index);
  port = (JViewport) pane.getComponent(0);
  table = (ResultSetTable) port.getComponent(0);
 }
 return table;
}

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

/**
 * returns the table of the current tab, can be NULL
 * 
 * @return the currently selected table
 */
protected ResultSetTable getCurrentTable() {
 ResultSetTable table;
 JScrollPane pane;
 JViewport port;
 int index;
 table = null;
 index = m_TabbedPane.getSelectedIndex();
 if (index > -1) {
  pane = (JScrollPane) m_TabbedPane.getComponentAt(index);
  port = (JViewport) pane.getComponent(0);
  table = (ResultSetTable) port.getComponent(0);
 }
 return table;
}

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

public final ArrayList getAvailableAttributes(Markable clickedMarkable)
{
  int index = 0;
  MMAX2AttributePanel panel = null;
  index = ((Integer)this.levelToIndex.get(clickedMarkable.getMarkableLevelName())).intValue();
  JScrollPane pane =(JScrollPane) tabbedPane.getComponentAt(index);
  JViewport port = (JViewport)pane.getComponent(0);
  panel = (MMAX2AttributePanel)port.getView();
  return panel.getAllCurrentAttributes();
  
}
/** This method is called when a Markable has been selected on the display. */

代码示例来源:origin: senbox-org/s2tbx

private void insertMessageLabel() {
  Container parent = getDefaultIOParametersPanel().getParent();
  JScrollPane scrollPane = (JScrollPane) parent.getComponent(1);
  JViewport viewport = (JViewport) scrollPane.getComponent(0);
  JPanel initial = (JPanel) viewport.getComponent(0);
  Dimension preferredSize = initial.getPreferredSize();
  JPanel wrapper = new JPanel(new BorderLayout());
  wrapper.add(initial, BorderLayout.NORTH);
  wrapper.add(messagePanel, BorderLayout.SOUTH);
  messagePanel.setVisible(false);
  wrapper.setPreferredSize(preferredSize);
  viewport.remove(initial);
  viewport.add(wrapper);
  final Dimension windowSize = this.getJDialog().getPreferredSize();
  this.getJDialog().setMinimumSize(new Dimension(windowSize.width, windowSize.height + 30));
}

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

public final void disableAll()
{
  // New: use tab count
  for (int z=0;z<tabbedPane.getTabCount();z++)
  {            
    JScrollPane pane = ((JScrollPane)tabbedPane.getComponentAt(z));
    JViewport port = (JViewport)pane.getComponent(0);
    ((MMAX2AttributePanel)port.getView()).setEnabled(false);
    ((MMAX2AttributePanel)port.getView()).rebuild();
    tabbedPane.setEnabledAt(z,true);
  }
  applyButton.setEnabled(false);
  undoButton.setEnabled(false);
}

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

JViewport port = (JViewport)pane.getComponent(0);
MMAX2AttributePanel tempPanel = (MMAX2AttributePanel) port.getView();
tempPanel.setOneClickAnnotationAttributeName(attribute);
JViewport port = (JViewport)pane.getComponent(0);
MMAX2AttributePanel selectedPanel = (MMAX2AttributePanel)port.getView();
tabbedPane.setSelectedIndex(index);
JScrollPane pane = (JScrollPane) tabbedPane.getSelectedComponent();
JViewport port = (JViewport)pane.getComponent(0);
MMAX2AttributePanel selectedPanel = (MMAX2AttributePanel)port.getView();

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

JViewport port = (JViewport)pane.getComponent(0);
JViewport port = (JViewport)pane.getComponent(0);
panel = (MMAX2AttributePanel) port.getView();

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

JEditorPane editorPane = (JEditorPane) ((Container)scrollPane.getComponent(0)).getComponent(0);
editorPane.setBackground(ColorController.FUNDO_BOTOES_EXPANSIVEIS);
editorPane.setForeground(ColorController.AMARELO);

相关文章

JScrollPane类方法