The location of a divider is measured in pixels from either the left edge (in the case of a horizontal split pane) or the top edge (in the case of a vertical split pane).

There are two ways to set the location of the divider. The first is to specify an absolute location based on the distance in pixels from the left or top edge. The second is to specify a proportional location based on the distance from the left or top edge. For example, a proportional location of 0 sets the divider at the left or top edge. A proportional location of 1 sets the divider at the right or bottom edge. A proportional location of .5 sets the divider at the center.

    // Create a left-right split pane
JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent); // Get current location; result is number of pixels from the left edge
int loc = pane.getDividerLocation(); // Set a new location using an absolution location; center the divider
loc = (int)((pane.getBounds().getWidth()-pane.getDividerSize())/2);
pane.setDividerLocation(loc); double propLoc = .5D;
// Set a proportional location
pane.setDividerLocation(propLoc);
Related Examples

e826. 获得和设置JSplitPane分开的位置的更多相关文章

  1. matplotlib之设置极坐标起点的位置

    #!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: polar.py #Auth ...

  2. Java基础 awt Frame 设置窗体的大小 位置 可见性

        JDK :OpenJDK-11      OS :CentOS 7.6.1810      IDE :Eclipse 2019‑03 typesetting :Markdown   code ...

  3. Mac 可设置环境变量的位置、查看和添加PATH环境变量

    Mac 启动加载文件位置(可设置环境变量) ------------------------------------------------------- (1)首先要知道你使用的Mac OS X是什 ...

  4. 3ds max画曲线 设置摄像机的起始位置

    参考 http://www.3dmax8.com/3dmax/2013/0916/5661.html 如果想创建曲线段,可以在单击下一个点时按住鼠标不放,继续拖曳,再拖到另一个点上,单击鼠标右键,即可 ...

  5. Mac可设置环境变量的位置、查看和添加PATH环境变量

    Mac 启动加载文件位置(可设置环境变量) 首先要知道你使用的 Mac OS X 是什么样的 Shell,使用命令 echo $SHELL 如果输出的是:csh 或者是 tcsh,那么你用的就是 C ...

  6. PL/SQL常用设置 可看引用位置更清晰直观 引自:http://blog.csdn.net/xiaoqforever/article/details/27695569

    引自:http://blog.csdn.net/xiaoqforever/article/details/27695569 1,登录后默认自动选中My Objects 默认情况下,PLSQL Deve ...

  7. (转)background-position—CSS设置背景图片的位置

    background-position :在 CSS 中通过 background-position 属性可以调整背景图片的位置.因为在默认情况下背景图片都是从设置了 background-posit ...

  8. unity3d在菜单栏,一键设置Player setting及自动打包并设置apk的存储位置

    项目进行中,领导要求能够进行一键设置Player settings及自动打包并设置apk的位置,所以自己就上网搜索了很多大神的文章.最后是完成了领导需要的功能,在这里记录并分享一下(此项指针对安卓ap ...

  9. 关于CKEditor4.5.6的使用,自定义toolbar配置,上传图片案例(SpringMVC+MyBatis案例),自定义行高,去编辑器的中内容,将编辑器中内容设置到指定的位置等

     关于CKEditor的一个配置整理,改文件为config.js: 文件内容如下: /** * @license Copyright (c) 2003-2016, CKSource - Frede ...

随机推荐

  1. Leetcode: Remove Duplicates from Sorted List II 解题报告

    Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplica ...

  2. 消息队列RabbitMQ基础知识详解

    一: 什么是MQ? MQ全称为Message Queue, 消息队列(MQ)是一种应用程序对应用程序或者模块对模块的通信方法.MQ是消费-生产者模型的一个典型的代表,一端往消息队列中不断写入消息,而另 ...

  3. 1. AutoEncoder介绍

    1. AutoEncoder介绍 2. Applications of AutoEncoder in NLP 3. Recursive Autoencoder(递归自动编码器) 4. Stacked ...

  4. 微服务之springCloud-docker-feign-hystrix(六)

    简介 上一节我们讨论feign的配置,这节我们讨论一下,feign+hystrix调用生产者时,进行容错处理 一.创建模块(microservice-consumer-movie-feign-with ...

  5. thinkphp验证码乱码的解决办法

    很有可能是入口文件index.php和.htaccess文件要转换成 以UTF-8无BOM格式编码

  6. MySQL日志——二进制日志

    Mac怎么这么坑呢,搞了2小时了.唉 先来一个简单的,挖好坑,明天解决. 终端进入mysql: mysql> set global general_log=on; 然后进行数据库的任意操作: 查 ...

  7. windows 下,CCXT库的安装

    CCTX 是一个 开源的关于数字货币交易的库 github 位置: https://github.com/ccxt/ccxt CCTX python 版本的安装 先安装python 3 然后以管理员的 ...

  8. Spring WebSocket教程(二)

    实现目标 这一篇文章,就要直接实现聊天的功能,并且,在聊天功能的基础上,再实现缓存一定聊天记录的功能. 第一步:聊天实现原理 首先,需要明确我们的需求.通常,网页上的聊天,都是聊天室的形式,所以,这个 ...

  9. Aspose.Cells Smart markers 基于模板导出Excel

    Aspose.Cells可以预先定义Excel模板,然后填充数据(官方文档:http://www.aspose.com/docs/display/cellsjava/Smart+Markers). 设 ...

  10. c# 读取excel数据的两种方法

    转载自:http://developer.51cto.com/art/201302/380622.htm, 方法一:OleDb: 用这种方法读取Excel速度还是非常的快的,但这种方式读取数据的时候不 ...