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改变大小时分配空间的更多相关文章

  1. 排查在 Azure 中创建、重启 Windows VM 或调整其大小时发生的分配失败

    创建 VM.重新启动已停止(解除分配)的 VM 和重设 VM 大小时,Azure 会为订阅分配计算资源. 执行这些操作时,即使尚未达到 Azure 订阅限制,也可能偶尔收到错误. 本文说明一些常见分配 ...

  2. 排查在 Azure 中创建、重启 Linux VM 或调整其大小时发生的分配故障

    创建 VM.重启已停止(解除分配)的 VM 和重设 VM 大小时,Azure 会为订阅分配计算资源. 执行这些操作时,即使尚未达到 Azure 订阅限制,也可能偶尔收到错误. 本文说明一些常见分配故障 ...

  3. PyQt通过resize改变窗体大小时ListWidget显示异常

    前几天开始的pygame音乐播放器Doco,做的差不多了,上午做到了歌词显示和搜索页面.遇到bug,即通过resize改变ui大小时ListWidget显示异常 #目的: 增加一部分窗口用来显示歌词和 ...

  4. JVM知识(一) 求你了,别再说Java对象都是在堆内存上分配空间的了!

    求你了,别再说Java对象都是在堆内存上分配空间的了! https://baijiahao.baidu.com/s?id=1661296872935371634&wfr=spider& ...

  5. new/new[]和delete/delete[]是如何分配空间以及释放空间的

    C++中程序存储空间除栈空间和静态区外,每个程序还拥有一个内存池,这部分内存被称为或堆(heap).程序可以用堆来存储动态分配的对象,即那些在程序运行时创建的对象.动态对象的生存期由程序来控制 ,当动 ...

  6. 未能为数据库 '*'中得对象'*'分配空间,因文件组'PRIMARY'已满

    服务器使用mssqlserver2005,最近经常出现无法新增信息错误,查看日志,发现严重错误提示,内容大致为: 无法为数据库 'weixin_main' 中的对象 'dbo.wx_logs'.'PK ...

  7. Android之使用weight属性实现控件的按比例分配空间

    从今天開始,把看书时候的知识点整理成博客, 这个比較简单,预计有经验的都用过,weight属性 在做Android布局的时候,常常遇到须要几个控件按比例分配空间的情况 比方下图效果 在底部设置两个bu ...

  8. resize([[data],fn]) 当调整浏览器窗口的大小时,发生 resize 事件。

    resize([[data],fn]) 概述 当调整浏览器窗口的大小时,发生 resize 事件.   参数 fnFunctionV1.0 在每一个匹配元素的resize事件中绑定的处理函数.直线电机 ...

  9. C++开发系列-C语言的malloc与C++的new分配空间

    概述 在软件开发过程中,常常需要动态地分配和撤销存储空间,例如对动态链表中结点的插入与删除.在C语言中是利用库函数malloc和free来分配和撤销内存空间的.C++提供了较简便而功能较强的运算符ne ...

随机推荐

  1. performance Counter

    Logman https://technet.microsoft.com/en-us/library/bb490956.aspx http://blogs.technet.com/b/askperf/ ...

  2. ASP.NET Core2.0 环境下MVC模式的支付宝PC网站支付接口-沙箱环境开发测试

    1.新建.NET Core web项目 2.Controllers-Models-Views 分三个大部分 3.下载安装最新sdk 官方的SDK以及Demo都还是.NET Framework的,根据官 ...

  3. Oracle客户端使用sqlldr导数据中文乱码问题解决方法

    String strctl = "OPTIONS (skip=0)" + // 0是从第一行开始 1是 从第二行 CHARACTERSET AL32UTF8 是为了解决导入中文为乱 ...

  4. 关于RPG游戏结构撰写的相关探索上篇

    本章节的目标是创造一个游戏理念.这个理念是: *简短的项目概括 *范围描述 *目标用户 *与其他游戏的区别 不要试图编写一款缺乏明确理念的RPG.因为这样可能只会产生与其他游戏雷同的项目. <i ...

  5. 【Java】Java复习笔记-三大排序算法,堆栈队列,生成无重复的随机数列

    冒泡排序 package com.lcw.bubble; public class BubbleSort { /** * 冒泡排序 * @param args * @author 成鹏致远 */ pu ...

  6. MySQL导入数据遇到Error Number: 1467 Failed to read auto-increment value from storage engine错误

    MySQL导入数据遇到Error Number: 1467 Failed to read auto-increment value from storage engine错误 创建表的语句 CREAT ...

  7. Java类的成员初始化顺序

    Java类的成员初始化顺序 2017-06-01 代码: public class InitializeSequence { public static void main(String[] args ...

  8. 监听的instance status blocked分析

    对于处于NOMOUNT状态的数据库,PMON还没有将服务注册到监听上,这个时候服务的状态是BLOCKED的,对于来自远程的任何连接都会报ORA-12528错误.如下: [oracle@dbtest ~ ...

  9. Git CMD连接,管理(remote,add,commit,push)github repository

    git initmd testcd testgit statusgit add test  //git add test/a.txtgit status git remote add origin g ...

  10. [转]MySQL DATE_FORMAT() 函数

    原文地址:http://www.w3school.com.cn/sql/func_date_format.asp 定义和用法 DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据. 语法 ...