« Return to Thread: Binding a javabeans property to JPanel.visible

Binding a javabeans property to JPanel.visible

by janneefef :: Rate this Message:

Reply to Author | View in Thread

No answers to previous question, I will try to form it better.

I'm trying to bind my bean's boolean property MyBean.someBoolean to a JPanel visibility. Trying this with beansbinding and Netbeans.

I can bind this nicely if I write the binding by hand:

public EditForm() {
        initComponents();
        bindingGroup2 = new org.jdesktop.beansbinding.BindingGroup();
        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding
                (org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
                myBean,
                org.jdesktop.beansbinding.ELProperty.create("${someBoolean}"),
                jPanel1,
                org.jdesktop.beansbinding.BeanProperty.create("visible"));

Now when I change someBoolean, panel is shown and hidden like it should be.

If I try to create this binding with Matisse, right click on the jPanel + "bind" gives only options background/border/foreground. Not visible like I'm looking for. This selection seems a bit random, where is it defined?

If I open the JPanel in properties -window, I have many more properties under "Binding" tab. There's stuff like maximumSize, focusable, autoscrolls etc under "Preferred", "Observable" and "Non-observable". But once again, visible is missing. 

 « Return to Thread: Binding a javabeans property to JPanel.visible