e826. 获得和设置JSplitPane分开的位置
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分开的位置的更多相关文章
- matplotlib之设置极坐标起点的位置
#!/usr/bin/env python3 #-*- coding:utf-8 -*- ############################ #File Name: polar.py #Auth ...
- Java基础 awt Frame 设置窗体的大小 位置 可见性
JDK :OpenJDK-11 OS :CentOS 7.6.1810 IDE :Eclipse 2019‑03 typesetting :Markdown code ...
- Mac 可设置环境变量的位置、查看和添加PATH环境变量
Mac 启动加载文件位置(可设置环境变量) ------------------------------------------------------- (1)首先要知道你使用的Mac OS X是什 ...
- 3ds max画曲线 设置摄像机的起始位置
参考 http://www.3dmax8.com/3dmax/2013/0916/5661.html 如果想创建曲线段,可以在单击下一个点时按住鼠标不放,继续拖曳,再拖到另一个点上,单击鼠标右键,即可 ...
- Mac可设置环境变量的位置、查看和添加PATH环境变量
Mac 启动加载文件位置(可设置环境变量) 首先要知道你使用的 Mac OS X 是什么样的 Shell,使用命令 echo $SHELL 如果输出的是:csh 或者是 tcsh,那么你用的就是 C ...
- PL/SQL常用设置 可看引用位置更清晰直观 引自:http://blog.csdn.net/xiaoqforever/article/details/27695569
引自:http://blog.csdn.net/xiaoqforever/article/details/27695569 1,登录后默认自动选中My Objects 默认情况下,PLSQL Deve ...
- (转)background-position—CSS设置背景图片的位置
background-position :在 CSS 中通过 background-position 属性可以调整背景图片的位置.因为在默认情况下背景图片都是从设置了 background-posit ...
- unity3d在菜单栏,一键设置Player setting及自动打包并设置apk的存储位置
项目进行中,领导要求能够进行一键设置Player settings及自动打包并设置apk的位置,所以自己就上网搜索了很多大神的文章.最后是完成了领导需要的功能,在这里记录并分享一下(此项指针对安卓ap ...
- 关于CKEditor4.5.6的使用,自定义toolbar配置,上传图片案例(SpringMVC+MyBatis案例),自定义行高,去编辑器的中内容,将编辑器中内容设置到指定的位置等
关于CKEditor的一个配置整理,改文件为config.js: 文件内容如下: /** * @license Copyright (c) 2003-2016, CKSource - Frede ...
随机推荐
- (转)Go和HTTPS
转自:http://studygolang.com/articles/2946 Go和HTTPS 2015-04-30 bigwhite 阅读 5688 次 4 人喜欢 3 条评论 收 ...
- (转)CTP: 平昨仓与平今仓,log轻轻告诉你.......
转自:http://blog.csdn.net/wowotuo/article/details/43242663 CTP的相关文档告诉我们,中金所和三大商品交易所中,只有上期所区分平今仓和平昨仓.也就 ...
- WeakReference 学习和使用
本文转自:http://qifuguang.me/2015/09/02/[Java%E5%B9%B6%E5%8F%91%E5%8C%85%E5%AD%A6%E4%B9%A0%E4%B8%83]%E8% ...
- 显示eclipse中Problem窗口的方法
https://blog.csdn.net/ningfuxuan/article/details/76395029 ****************************************** ...
- maven多环境发布.
需要设定profile和build <profiles> <profile> <id>develop</id> <properties> & ...
- 【MLP】多层感知机网络
BPN(Back Propagation Net) 反向传播神经网络是对非线性可微分函数进行权值训练的多层网络,是前向神经网络的一种. BP网络主要用于: 1)函数逼近与预测分析:用输入矢量和相应的输 ...
- decode和encode
作者:于洋链接:https://www.zhihu.com/question/23374078/answer/69732605来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出 ...
- 1. CNN卷积网络-初识
1. CNN卷积网络-初识 2. CNN卷积网络-前向传播算法 3. CNN卷积网络-反向更新 1. 前言 卷积神经网络是一种特殊的深层的神经网络模型,它的特殊性体现在两个方面, 它的神经元间的连接是 ...
- [wdt]watchdog
board/ti/am335x/board.c board/ti/am43xx/board.c driver/watchdog/omap_wdt.c include/configs/am43xx_ev ...
- Java编程的逻辑 (64) - 常见文件类型处理: 属性文件/CSV/EXCEL/HTML/压缩文件
本系列文章经补充和完善,已修订整理成书<Java编程的逻辑>,由机械工业出版社华章分社出版,于2018年1月上市热销,读者好评如潮!各大网店和书店有售,欢迎购买,京东自营链接:http: ...