转:JXCollapsiblePane/JXTaskPane via NetBeans 6.9.1 designer

http://forums.netbeans.org/ntopic32575.html

————————————————————————————————————————————————————————————————

AuthorMessage
jim_akmer



Joined: 20 Oct 2010
Posts: 2

PostPosted: Wed Oct 20, 2010 12:15 pm    Post subject: JXCollapsiblePane/JXTaskPane via NetBeans 6.9.1 designer

Hi,

I am new in SwingX and I have trouble using JXCollapsiblePane and JXTaskPane using Pallete manager of Netbeans 6.9.1
Specifically:
For JXTaskPane:
1)I drag a JXTaskPaneContainer from pallete manager in a JForm
2)I drag a JXTaskPane from pallete manager into JXTaskPaneContainer
3)I try to add a jpanel or a jbutton in the JXTaskPane but I get the message "Cannot enclose components in a non-empty container"
If I add the components programmatically (as in example code I found i don't get an error and seems to work)

For JXCollapsiblePane:
1)I drag a JXCollapsiblePane from pallete manager in a JForm
2)I try to add a jpanel or a jbutton in the JXCollapsiblePane but I get the message "Cannot enclose components in a non-empty container"
If I add the components programmatically (as in example code I found i don't get an error and seems to work)

Can someone please explain what am I doing wrong?Is it not possible to do this using the Netbeans pallete designer?
I want to design my form visually. Is it possible for the components I am trying to use?
Note:I was adviced to ask a Netbean forum from the SwingX forum.
http://forums.java.net/jive/thread.jspa?messageID=485716?

Thank you.
[/url]
Back to top
View user's profile Send private message  
John Lussmyer
Posted via mailing list.





PostPosted: Wed Oct 20, 2010 9:27 pm    Post subject: JXCollapsiblePane/JXTaskPane via NetBeans 6.9.1 designer

Quote:
-----Original Message-----
From: jim_akmer [mailto:address-removed]

I am new in SwingX and I have trouble using JXCollapsiblePane and
JXTaskPane using Pallete manager of Netbeans 6.9.1
Specifically:
For JXTaskPane:
1)I drag a JXTaskPaneContainer from pallete manager in a JForm
2)I drag a JXTaskPane from pallete manager into JXTaskPaneContainer
3)I try to add a jpanel or a jbutton in the JXTaskPane but I get the
message "Cannot enclose components in a non-empty container"
If I add the components programmatically (as in example code I found i
don't get an error and seems to work)

You aren't doing anything wrong.
NetBeans GUI editor just doesn't work with those controls.
It's a royal PITA since the SwingX have some nice features.
Back to top

 
jim_akmer



Joined: 20 Oct 2010
Posts: 2

PostPosted: Thu Oct 21, 2010 8:15 am    Post subject:

The swingx-beaninfo.jar was missing from my project. Works now
 

转载于:https://www.cnblogs.com/cuizhf/archive/2011/11/03/2234611.html

tooltrip漂浮(在toolstrippanel和之外) 具体设计思想如下: 放置到ToolStripPanel上的,当工具栏浮动的时候,事实上是改变了其所在的容器对象,从其所在的ToolStripPanel移动到一个漂浮的容器上,因此要实现工具栏的浮动必须解决以下两个问题:     必须有一个浮动的容器来承载ToolStrip对象。     须知道ToolStrip对象何时改变其所在的容器,即在浮动的容器和主窗口上ToolStripPanel之间停靠。   对于第一个问题,我们的解决方案是动态的创建一个Form类作为浮动的容器,命名为ToolStripFloatWindow,该Form对象具有以下的属性:     FormBorderStyle = FixedToolWindow 边框样式     ShowInTaskbar = false 不在任务栏显示     ShowIcon = false 不显示窗口图标     TopMost = true 在所有窗口之上   为了解决第二个问题,我们查阅MSDN获知,当用鼠标拖拽ToolStrip对象释放鼠标时会触发其EndDrag事件。 我们在这个事件的处理方法中判断当ToolStrip对象的位置被移动到所在的ToolStripPanel之外的时候,创建ToolStripFloatWindow对象,并将ToolStrip对象移动到ToolStripFloatWindow上;要使ToolStrip对象恢复到原来的窗体上只要判断ToolStripFloatWindow对象的位置是否移动到了ToolStripPanel上, 当条件满足时将ToolStrip对象移动回ToolStripPanel中并销毁ToolStripFloatWindow对象。   此外,还要解决当ToolStrip对象放置到ToolStripFloatWindow对象上时, ToolStripFloatWindow对象必须与ToolStrip对象的尺寸一致。 还有ToolStripFloatWindow对象被点击了关闭按钮时不能将自己关闭。我们可以做两个类来实现上述的思路。 ToolStripFloatWindow类继承自Form类。 MyToolStrip 继承自ToolStrip类。增加了相应的属性和方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值