javax.swing.JSplitPane.setPreferredSize()方法的使用及代码示例

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

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

JSplitPane.setPreferredSize介绍

暂无

代码示例

代码示例来源:origin: deathmarine/Luyten

spt.setPreferredSize(new Dimension(this.getWidth(), 24));
this.add(spt, BorderLayout.SOUTH);
if (fileFromCommandLine != null) {

代码示例来源:origin: knowm/XChart

/** Constructor */
public XChartDemo() {
 super(new GridLayout(1, 0));
 // Create the nodes.
 DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts");
 createNodes(top);
 // Create a tree that allows one selection at a time.
 tree = new JTree(top);
 tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 // Listen for when the selection changes.
 tree.addTreeSelectionListener(this);
 // Create the scroll pane and add the tree to it.
 JScrollPane treeView = new JScrollPane(tree);
 // Create Chart Panel
 chartPanel = new XChartPanel(new AreaChart01().getChart());
 // Add the scroll panes to a split pane.
 splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
 splitPane.setTopComponent(treeView);
 splitPane.setBottomComponent(chartPanel);
 Dimension minimumSize = new Dimension(130, 160);
 treeView.setMinimumSize(minimumSize);
 splitPane.setPreferredSize(new Dimension(700, 700));
 // Add the split pane to this panel.
 add(splitPane);
}

代码示例来源:origin: knowm/XChart

protected void init() {
 // Create the nodes.
 DefaultMutableTreeNode top = new DefaultMutableTreeNode("XChart Example Charts");
 createNodes(top);
 tree = new JTree(top);
 // Create a tree that allows one selection at a time.
 tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
 // Listen for when the selection changes.
 tree.addTreeSelectionListener(this);
 // Create the scroll pane and add the tree to it.
 JScrollPane treeView = new JScrollPane(tree);
 // Create Chart Panel
 tabbedPane = new JTabbedPane();
 for (int i = 0; i < tree.getRowCount(); i++) {
  tree.expandRow(i);
 }
 // select first leaf
 DefaultMutableTreeNode firstLeaf = top.getFirstLeaf();
 tree.setSelectionPath(new TreePath(firstLeaf.getPath()));
 // Add the scroll panes to a split pane.
 splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
 splitPane.setTopComponent(treeView);
 splitPane.setBottomComponent(tabbedPane);
 Dimension minimumSize = new Dimension(130, 160);
 treeView.setMinimumSize(minimumSize);
 splitPane.setPreferredSize(new Dimension(700, 700));
 // Add the split pane to this panel.
 add(splitPane);
}

代码示例来源:origin: org.apache.james/apache-mime4j-examples

/**
 * Creates a new <code>MessageTree</code> instance displaying the
 * specified <code>Message</code>.
 *
 * @param message the message to display.
 */
public MessageTree(Message message) {
  super(new GridLayout(1,0));
  DefaultMutableTreeNode root = createNode(message);
  tree = new JTree(root);
  tree.getSelectionModel().setSelectionMode(
      TreeSelectionModel.SINGLE_TREE_SELECTION);
  tree.addTreeSelectionListener(this);
  JScrollPane treeView = new JScrollPane(tree);
  JPanel contentPane = new JPanel(new GridLayout(1, 0));
  JScrollPane contentView = new JScrollPane(contentPane);
  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  splitPane.setLeftComponent(treeView);
  splitPane.setRightComponent(contentView);
  Dimension minimumSize = new Dimension(100, 50);
  contentView.setMinimumSize(minimumSize);
  treeView.setMinimumSize(minimumSize);
  splitPane.setDividerLocation(250);
  splitPane.setPreferredSize(new Dimension(750, 500));
  add(splitPane);
  textView = new JTextArea();
  textView.setEditable(false);
  textView.setLineWrap(true);
  contentPane.add(textView);
}

代码示例来源:origin: org.boofcv/demonstrations

public DetectQrCodeMessagePanel(Listener listener ) {
  this.listener = listener;
  listDetected = new JList();
  listDetected.setModel(new DefaultListModel());
  listDetected.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  listDetected.setLayoutOrientation(JList.VERTICAL);
  listDetected.setVisibleRowCount(-1);
  listDetected.addListSelectionListener(this);
  textArea.setEditable(false);
  textArea.setWrapStyleWord(true);
  textArea.setLineWrap(true);
  // ensures that the split pane can be dragged
  Dimension minimumSize = new Dimension(0, 0);
  listDetected.setMinimumSize(minimumSize);
  textArea.setMinimumSize(minimumSize);
  JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,new JScrollPane(listDetected),textArea);
  splitPane.setDividerLocation(150);
  splitPane.setPreferredSize(new Dimension(200,0));
  addAlignCenter(new JLabel("QR-Codes"));
  addAlignCenter(splitPane);
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

private void createVerticalSplitPane() {
  this.verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
  this.verticalSplitPane.setResizeWeight(0.8);
  this.verticalSplitPane.setPreferredSize(new Dimension(620, 600));
  this.verticalSplitPane.setMinimumSize(new Dimension(200, 200));
  // add JTextPane to top of vertical split pane
  this.createTextScrollPane();
  this.verticalSplitPane.setTopComponent(this.textScrollPane);
  // bottom pane is the legend, with checkboxes
  this.verticalSplitPane.setBottomComponent(this.createTabbedChoicePane());
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

/**
 * @see Component#setSize(Dimension)
 */
public void setSize(Dimension d) {
  super.setSize(d);
  Insets insets = getInsets();
  Dimension paneSize = new Dimension(d.width - insets.left - insets.right, d.height - insets.top
      - insets.bottom);
  this.horizontalSplitPane.setPreferredSize(paneSize);
  this.horizontalSplitPane.setSize(paneSize);
}

代码示例来源:origin: org.apache.uima/uimaj-tools

/**
 * Creates the vertical split pane.
 */
private void createVerticalSplitPane() {
 this.verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
 this.verticalSplitPane.setResizeWeight(0.8);
 this.verticalSplitPane.setPreferredSize(new Dimension(620, 600));
 this.verticalSplitPane.setMinimumSize(new Dimension(200, 200));
 // add JTextPane to top of vertical split pane
 this.createTextScrollPane();
 this.verticalSplitPane.setTopComponent(this.textScrollPane);
 // bottom pane is the legend, with checkboxes
 this.verticalSplitPane.setBottomComponent(this.createTabbedChoicePane());
}

代码示例来源:origin: org.apache.uima/uimaj-tools

/**
 * Sets the size.
 *
 * @param d the new size
 * @see java.awt.Component#setSize(Dimension)
 */
@Override
public void setSize(Dimension d) {
 super.setSize(d);
 Insets insets = getInsets();
 Dimension paneSize = new Dimension(d.width - insets.left - insets.right, d.height - insets.top
     - insets.bottom);
 this.horizontalSplitPane.setPreferredSize(paneSize);
 this.horizontalSplitPane.setSize(paneSize);
}

代码示例来源:origin: org.apache.uima/uimaj-tools

/**
 * Sets the size.
 *
 * @param d the new size
 * @see java.awt.Component#setSize(Dimension)
 */
@Override
public void setSize(Dimension d) {
 super.setSize(d);
 Insets insets = getInsets();
 Dimension paneSize = new Dimension(d.width - insets.left - insets.right, d.height - insets.top
     - insets.bottom);
 splitPane.setPreferredSize(paneSize);
 splitPane.setSize(paneSize);
}

代码示例来源:origin: org.zaproxy/zap

private JSplitPane getSplitPane() {
  if (splitPane == null) {
    splitPane = new JSplitPane();
    splitPane.setName("AlertPanels");
    splitPane.setDividerSize(3);
    splitPane.setDividerLocation(400);
    splitPane.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    // Add toolbar
    JPanel panel = new JPanel();
    panel.setLayout(new GridBagLayout());
    panel.add(this.getPanelToolbar(), LayoutHelper.getGBC(0, 0, 1, 0.0D));
    panel.add(getPaneScroll(), LayoutHelper.getGBC(0, 1, 1, 1.0D, 1.0D));
    
    splitPane.setLeftComponent(panel);
    
    splitPane.setRightComponent(getAlertViewPanel());
    splitPane.setPreferredSize(new Dimension(100,200));
  }
  return splitPane;
}

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

mainPanel.setDividerLocation(0.75);
mainPanel.setPreferredSize(new Dimension(formWidth, formHeight));

代码示例来源:origin: uk.org.mygrid.taverna.scufl.scufl-ui-components/workflow-input-panel

splitter.setContinuousLayout(false);
splitter.setLeftComponent(scrollPane);
splitter.setPreferredSize(new Dimension(0, 0));

代码示例来源:origin: locationtech/jts

jSplitPane1.setPreferredSize(new Dimension(601, 690));
jPanel1.setLayout(borderLayout2);
jPanel1.setMinimumSize(new Dimension(431, 0));

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-propertyeditors

mainSplitPane.setPreferredSize(new java.awt.Dimension(400, 650));

代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz

treeView.setMinimumSize(JBroFuzzFormat.ZERO_DIM);
splitPane.setDividerLocation(100);
splitPane.setPreferredSize(new Dimension(100, 0));

代码示例来源:origin: org.biojava.thirdparty/forester

public NodePanel( final PhylogenyNode phylogeny_node ) {
  String node_name = "";
  if ( !ForesterUtil.isEmpty( phylogeny_node.getName() ) ) {
    node_name = phylogeny_node.getName() + " ";
  }
  final DefaultMutableTreeNode top = new DefaultMutableTreeNode( "Node " + node_name );
  createNodes( top, phylogeny_node );
  _tree = new JTree( top );
  _tree.setEditable( false );
  getJTree().setToggleClickCount( 1 );
  expandPath( BASIC );
  expandPath( TAXONOMY );
  expandPath( SEQUENCE );
  expandPath( EVENTS );
  final JScrollPane tree_view = new JScrollPane( getJTree() );
  _pane = new JEditorPane();
  _pane.setEditable( false );
  final JScrollPane data_view = new JScrollPane( _pane );
  final JSplitPane split_pane = new JSplitPane( JSplitPane.VERTICAL_SPLIT );
  split_pane.setTopComponent( tree_view );
  split_pane.setBottomComponent( data_view );
  data_view.setMinimumSize( Constants.NODE_PANEL_SPLIT_MINIMUM_SIZE );
  tree_view.setMinimumSize( Constants.NODE_PANEL_SPLIT_MINIMUM_SIZE );
  split_pane.setDividerLocation( 400 );
  split_pane.setPreferredSize( Constants.NODE_PANEL_SIZE );
  add( split_pane );
}

代码示例来源:origin: org.boofcv/demonstrations

@Override
protected void handleInputChange(int source, InputMethod method, int width, int height) {
  if( source != 0 )
    return;
  fps = -1;
  numFaults = 0;
  frameNumber = 0;
  alg.reset();
  alg.setCalibration(config.visualParam,new DoNothing2Transform2_F32());
  statusPanel.reset();
  handleRunningStatus(Status.RUNNING);
  guiCam3D.init();
  guiCam3D.setFocalLength(300);
  guiCam3D.setStepSize(0.05);
  guiCam3D.setPreferredSize(new Dimension(config.visualParam.width, config.visualParam.height));
  viewPanel.setPreferredSize(new Dimension(width*2+20, height));
  viewPanel.setDividerLocation(width);
  viewPanel.setMaximumSize(viewPanel.getPreferredSize());
}

代码示例来源:origin: org.biojava.thirdparty/forester

tree_view.setMinimumSize( Constants.NODE_PANEL_SPLIT_MINIMUM_SIZE );
split_pane.setPreferredSize( Constants.NODE_PANEL_SIZE );
add( split_pane );
getJTree().getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );

代码示例来源:origin: zolyfarkas/spf4j

mainSplitPannel.setPreferredSize(new java.awt.Dimension(600, 500));

相关文章

JSplitPane类方法