Results 1 to 7 of 7

Thread: Refresh a binding

  1. #1
    Join Date
    Sep 2006
    Location
    Belgium
    Posts
    70

    Default Refresh a binding

    Hi,

    I created my own Binding IconBiding based on the LabelBinding. In my form I add this binding to the formBuilder and all is ok.

    Now, I want to refresh it because the icon has changed. How I can do it?

    Thanks
    Dominique

  2. #2
    Join Date
    Apr 2006
    Location
    Germany, Berlin
    Posts
    61

    Default

    you have to implement valueModelChanged(Object) of LabelBinding:

    Code:
    protected void valueModelChanged(Object newValue) {
        label.setIcon((Icon)newValue);
    }
    ___
    Mathias

  3. #3
    Join Date
    Sep 2006
    Location
    Belgium
    Posts
    70

    Default

    This done, but how I can call it or trigger it from my AbstractForm class.

    Cheers
    Dominique

  4. #4
    Join Date
    Apr 2006
    Location
    Germany, Berlin
    Posts
    61

    Default

    you do this through formmodel:

    formModel.getValueModel("iconfield").setValue(newI con);
    ___
    Mathias

  5. #5
    Join Date
    Aug 2005
    Location
    Clermont-Ferrand / France
    Posts
    21

    Default

    Hello,

    Excuse me but I don't see the use case of IconBinding ? (No doubt there is).

    Thank you,

    Christophe.

  6. #6
    Join Date
    Sep 2006
    Location
    Belgium
    Posts
    70

    Default

    Thanks Mathias it works ;-)

    Christophe: In my case I have to scan a document and when the scanning is finished I would like to show it on the screen, the only way I found up to now (may be there is another way) is to transform the java.awt.image i get into a java.swing.ImageIcon and to display it I use the JLabel.setIcon.

    May be you have another idea?

    Regards
    Dominique

  7. #7
    Join Date
    Aug 2005
    Location
    Clermont-Ferrand / France
    Posts
    21

    Default

    Thank you for these precisions.

    Christophe.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •