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

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

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

JScrollPane.getBorder介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public Border getBorder() {
  if (isSynth) {
    return BorderFactory.createEmptyBorder();
  } else {
    return super.getBorder();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public Border getBorder() {
  if (isSynth) {
    return BorderFactory.createEmptyBorder();
  } else {
    return super.getBorder();
  }
}

代码示例来源:origin: org.scijava/scijava-ui-swing

private Insets getScrollPaneInsets() {
  JScrollPane scrollPane = getScrollPane();
  if ((scrollPane == null) || (getScrollPane().getBorder() == null)) {
    return new Insets(0, 0, 0, 0);
  }
  return getScrollPane().getBorder().getBorderInsets(scrollPane);
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

private Insets getScrollPaneInsets() {
  JScrollPane scrollPane = getScrollPane();
  if ((scrollPane == null) || (getScrollPane().getBorder() == null)) {
    return new Insets(0, 0, 0, 0);
  } else {
    return getScrollPane().getBorder().getBorderInsets(scrollPane);
  }
}

代码示例来源:origin: net.imagej/ij-ui-swing

private Insets getScrollPaneInsets() {
  JScrollPane scrollPane = getScrollPane();
  if ((scrollPane == null) || (getScrollPane().getBorder() == null)) {
    return new Insets(0, 0, 0, 0);
  }
  return getScrollPane().getBorder().getBorderInsets(scrollPane);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-common

private MissingDatabaseConnectionWarning(Project project) {
  initComponents();
  this.project = project;
  datasourceList.setModel(new DatasourceListModel());
  scrollPaneBorder = jScrollPane2.getBorder();
  initDatasourceList();
}

代码示例来源:origin: fcrepo3/fcrepo

private Insets getScrollPaneInsets() {
  JScrollPane scrollPane = getScrollPane();
  if (scrollPane == null) {
    return new Insets(0, 0, 0, 0);
  } else {
    return getScrollPane().getBorder().getBorderInsets(scrollPane);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf

private void createTemplateView() {
  BeanTreeView btv = new BeanTreeView();
  btv.setRootVisible(false);
  btv.setSelectionMode(javax.swing.tree.TreeSelectionModel.SINGLE_TREE_SELECTION);
  btv.setBorder(SAMPLE_SCROLL_PANE.getBorder());
  btv.getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/jsf/dialogs/Bundle").getString("ACSN_FlodersTree"));
  btv.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/jsf/dialogs/Bundle").getString("ACSD_FlodersTree"));
  jLabel1.setLabelFor(btv.getViewport().getView());
  folderPanel.add(btv, java.awt.BorderLayout.CENTER);
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

private JScrollPane createScrollPane(Component inner) {
  JScrollPane result = new JScrollPane(inner);
  JViewport vp = result.getViewport();
  vp.addMouseListener(this);
  MarginViewportUI ui = (MarginViewportUI) MarginViewportUI.createUI(vp);
  vp.setUI(ui);
  ui.setMarginPainted(marginPainted);
  ui.setMarginColor(marginColor);
  ui.setEmptyString(emptyString);
  result.setBorder(BorderFactory.createEmptyBorder());
  result.setViewportBorder(result.getBorder());
  return result;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

private JScrollPane createScrollPane (Component inner) {
  JScrollPane result = new JScrollPane (inner);
  JViewport vp = result.getViewport();
  vp.addMouseListener(this);
  MarginViewportUI ui = (MarginViewportUI) MarginViewportUI.createUI (vp);
  vp.setUI(ui);
  ui.setMarginPainted (marginPainted);
  ui.setMarginColor (marginColor);
  ui.setEmptyString (emptyString);
  result.setBorder (BorderFactory.createEmptyBorder());
  result.setViewportBorder(result.getBorder());
  return result;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

private JScrollPane createScrollPane (Component inner) {
  JScrollPane result = new JScrollPane (inner);
  JViewport vp = result.getViewport();
  vp.addMouseListener(this);
  MarginViewportUI ui = (MarginViewportUI) MarginViewportUI.createUI (vp);
  vp.setUI(ui);
  ui.setMarginPainted (marginPainted);
  ui.setMarginColor (marginColor);
  ui.setEmptyString (emptyString);
  result.setBorder (BorderFactory.createEmptyBorder());
  result.setViewportBorder(result.getBorder());
  return result;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

public MyTree() {
  setBorder(scrollPane.getBorder());
  setViewportBorder(scrollPane.getViewportBorder());
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

public MyTree() {
  setBorder(scrollPane.getBorder());
  setViewportBorder(scrollPane.getViewportBorder());
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

@Override
  public void updateUI() {
    super.updateUI();
    setBorder(scrollPane.getBorder());
    setViewportBorder(scrollPane.getViewportBorder());
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

@Override
  public void updateUI() {
    super.updateUI();
    setBorder(scrollPane.getBorder());
    setViewportBorder(scrollPane.getViewportBorder());
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

public void setNormalSize() {
  JScrollPane scrollPane = getScrollPane();
  Insets scrollInsets = getScrollPaneInsets();
  
  if (scrollPane != null) {
    Dimension d = scrollPane.getVisibleRect().getSize();
    if (scrollPane.getBorder() != null) {
      d.setSize(d.getWidth() - scrollInsets.left - scrollInsets.right,
          d.getHeight() - scrollInsets.top - scrollInsets.bottom);
    }
    
    d.setSize(d.getWidth() - 20, d.getHeight() - 20);
    desktop.setAllSize(d);
    scrollPane.invalidate();
    scrollPane.validate();
  }
}

代码示例来源:origin: org.scijava/scijava-ui-swing

public void setNormalSize() {
  JScrollPane scrollPane = getScrollPane();
  Insets scrollInsets = getScrollPaneInsets();
  
  if (scrollPane != null) {
    Dimension d = scrollPane.getVisibleRect().getSize();
    if (scrollPane.getBorder() != null) {
      d.setSize(d.getWidth() - scrollInsets.left - scrollInsets.right,
          d.getHeight() - scrollInsets.top - scrollInsets.bottom);
    }
    
    d.setSize(d.getWidth() - 20, d.getHeight() - 20);
    desktop.setAllSize(d);
    scrollPane.invalidate();
    scrollPane.validate();
  }
}

代码示例来源:origin: net.imagej/ij-ui-swing

public void setNormalSize() {
  JScrollPane scrollPane = getScrollPane();
  Insets scrollInsets = getScrollPaneInsets();
  
  if (scrollPane != null) {
    Dimension d = scrollPane.getVisibleRect().getSize();
    if (scrollPane.getBorder() != null) {
      d.setSize(d.getWidth() - scrollInsets.left - scrollInsets.right,
          d.getHeight() - scrollInsets.top - scrollInsets.bottom);
    }
    
    d.setSize(d.getWidth() - 20, d.getHeight() - 20);
    desktop.setAllSize(d);
    scrollPane.invalidate();
    scrollPane.validate();
  }
}

代码示例来源:origin: triplea-game/triplea

@Test
public void build_ShouldSetBorderWhenProvided() {
 final Border border = BorderFactory.createEmptyBorder();
 final JScrollPane scrollPane = builder
   .view(new JLabel())
   .border(border)
   .build();
 assertThat(scrollPane.getBorder(), is(sameInstance(border)));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-clientproject

BrowseFolders(SourceGroup[] folders, Class<?> target, String preselectedFileName) {
  initComponents();
  String description = target == DataFolder.class ? "ACSD_BrowseFolders" : "ACSD_BrowseFiles"; // NOI18N
  getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(BrowseFolders.class, description));
  this.folders = folders;
  this.target = target;
  manager = new ExplorerManager();
  AbstractNode rootNode = new AbstractNode(new SourceGroupsChildren(folders));
  manager.setRootContext(rootNode);
  // Create the templates view
  btv = new BeanTreeView();
  btv.setRootVisible(false);
  btv.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  btv.setBorder(SAMPLE_SCROLL_PANE.getBorder());
  expandSelection(preselectedFileName);
  folderPanel.add(btv, BorderLayout.CENTER);
}

相关文章

JScrollPane类方法