e825. 当JSplitPane改变大小时分配空间
The weight of a split pane controls the behavior of the divider when the split pane is resized. If the weight is 0, all extra space is given to the right or bottom component. If the weight is 1, all extra space is given to the left or top component. A weight of .3 specifies that the left or top component gets one-third of the extra space. The weight also determines how the children lose space when the size of the split pane is reduced. For example, a weight of 0 means that the left or top component does not lose any space.
The weight also controls the starting location of the divider. For example, if the weight is .5, the divider is placed in the center.
// Create a left-right split pane
JSplitPane pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftComponent, rightComponent); // Get current weight
double weight = pane.getResizeWeight(); // 0.0 by default // Keep the size of the right component constant
weight = 1D;
pane.setResizeWeight(weight); // Split the space evenly
weight = .5D;
pane.setResizeWeight(weight);
| Related Examples |
e825. 当JSplitPane改变大小时分配空间的更多相关文章
- 排查在 Azure 中创建、重启 Windows VM 或调整其大小时发生的分配失败
创建 VM.重新启动已停止(解除分配)的 VM 和重设 VM 大小时,Azure 会为订阅分配计算资源. 执行这些操作时,即使尚未达到 Azure 订阅限制,也可能偶尔收到错误. 本文说明一些常见分配 ...
- 排查在 Azure 中创建、重启 Linux VM 或调整其大小时发生的分配故障
创建 VM.重启已停止(解除分配)的 VM 和重设 VM 大小时,Azure 会为订阅分配计算资源. 执行这些操作时,即使尚未达到 Azure 订阅限制,也可能偶尔收到错误. 本文说明一些常见分配故障 ...
- PyQt通过resize改变窗体大小时ListWidget显示异常
前几天开始的pygame音乐播放器Doco,做的差不多了,上午做到了歌词显示和搜索页面.遇到bug,即通过resize改变ui大小时ListWidget显示异常 #目的: 增加一部分窗口用来显示歌词和 ...
- JVM知识(一) 求你了,别再说Java对象都是在堆内存上分配空间的了!
求你了,别再说Java对象都是在堆内存上分配空间的了! https://baijiahao.baidu.com/s?id=1661296872935371634&wfr=spider& ...
- new/new[]和delete/delete[]是如何分配空间以及释放空间的
C++中程序存储空间除栈空间和静态区外,每个程序还拥有一个内存池,这部分内存被称为或堆(heap).程序可以用堆来存储动态分配的对象,即那些在程序运行时创建的对象.动态对象的生存期由程序来控制 ,当动 ...
- 未能为数据库 '*'中得对象'*'分配空间,因文件组'PRIMARY'已满
服务器使用mssqlserver2005,最近经常出现无法新增信息错误,查看日志,发现严重错误提示,内容大致为: 无法为数据库 'weixin_main' 中的对象 'dbo.wx_logs'.'PK ...
- Android之使用weight属性实现控件的按比例分配空间
从今天開始,把看书时候的知识点整理成博客, 这个比較简单,预计有经验的都用过,weight属性 在做Android布局的时候,常常遇到须要几个控件按比例分配空间的情况 比方下图效果 在底部设置两个bu ...
- resize([[data],fn]) 当调整浏览器窗口的大小时,发生 resize 事件。
resize([[data],fn]) 概述 当调整浏览器窗口的大小时,发生 resize 事件. 参数 fnFunctionV1.0 在每一个匹配元素的resize事件中绑定的处理函数.直线电机 ...
- C++开发系列-C语言的malloc与C++的new分配空间
概述 在软件开发过程中,常常需要动态地分配和撤销存储空间,例如对动态链表中结点的插入与删除.在C语言中是利用库函数malloc和free来分配和撤销内存空间的.C++提供了较简便而功能较强的运算符ne ...
随机推荐
- [Windows Azure] How to use the Windows Azure Blob Storage Service in .NET
How to use the Windows Azure Blob Storage Service in .NET version 1.7 version 2.0 This guide will de ...
- MyBean-关于plugMap共享对象
plugMap实现了对象的存储,使用setObject,和getObject来对对象进行存储 内部其实是一个列表,而且他会在释放的时候会情况尝试释放所有的对象,所以如果你共享的对象提前进行了释放, ...
- JAVA Zero Copy的相关知识【转】
转自:https://my.oschina.net/cloudcoder/blog/299944 摘要: java 的zero copy多在网络应用程序中使用.Java的libaries在linux和 ...
- Python解码base64遇到Incorrect padding错误
Python解码base64遇到Incorrect padding错误 base64转码过程 先说一下转换过程,详细的可以参考阮一峰.廖雪峰博客: 所谓Base64,就是说选出64个字符----小写字 ...
- Ubuntu下golang环境搭建
参考官方文档:https://golang.org/doc/editors.html 1.安装golang apt install golang 2.配置GOPATH mkdir ~/gopath v ...
- [Java]随记--HttpClient发送put请求
http://blog.csdn.net/u010989191/article/details/52852155 ******************************************* ...
- js利用clipboardData在网页中实现截屏粘贴的功能
目前仅有高版本的 Chrome 浏览器支持这样直接粘贴,其他浏览器目前为止还无法粘贴,不过火狐和ie11浏览器在可编辑的div中能够粘贴截图的图片也是base64位和Chrome利用clipboard ...
- R语言统计分析应用与SAS、SPSS的比较
能够用来做统计分析的软件和程序很多,目前应用比较广泛的包括:SPSS, SAS.R语言,Matlab,S-PLUS,S-Miner等.下面我们来看一下各应用的特点: SPSS: 最简单的,都是菜单操作 ...
- 前端弹窗展示后台html文件
1,首先使用window.open函数,弹出返回jsp页面的窗口,对应viewZhengXinReport()方法,进行jsp页面的请求跳转forward 2,然后在jsp页面中使用ajax同步请求后 ...
- JS 对应CSS 样式
首先,把CSS和JS标签style属性对照表了解了: CSS 和 JavaScript 标签 style 属性对照表: 盒子标签和属性对照 颜色和背景标签和属性对照 样式标签和属性对照 文字样式标签和 ...