tomaer319 2009-07-17 11:45
浏览 1400
已采纳

为什么doLayout()没有用呢?

我想动态再我的布局中添加一些组件,但是无法显示出来,后来在网上查了一下是要调用一下doLayout(),但是还是没有用。
[b]问题补充:[/b]
对我的布局就是border布局,我想动态添加west

  • 写回答

4条回答 默认 最新

  • zhoujuan520 2009-07-17 12:09
    关注

    Notes:

    * Any container using the BorderLayout must have a child item with region:'center'. The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout.
    * Any child items with a region of west or east must have width defined (an integer representing the number of pixels that the region should take up).
    * Any child items with a region of north or south must have height defined.
    * The regions of a BorderLayout are fixed at render time and thereafter, its child Components may not be removed or added. To add/remove Components within a BorderLayout, have them wrapped by an additional Container which is directly managed by the BorderLayout. If the region is to be collapsible, the Container used directly by the BorderLayout manager should be a Panel. In the following example a Container (an Ext.Panel) is added to the west region: 
    

    这个是原文,大意就是border布局不能够动态增加和删除子组件,建议你先把你不想看到的部分折叠起来.这样比较好

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题