X

Geertjan's Blog

  • August 28, 2006

In Place Editor in Visual Library 2.0

Geertjan Wielenga
Product Manager
One of the nice things about the NetBeans Visual Library 2.0 is its in place editor. First some screenshots. Below, you see what happens when I double-click on a label—I can change the name of one of the Simpsons:

Also, when I hover with the mouse over a label, it is highlighted in light blue; while when I select a label, it is highlighted in dark blue. So below I have selected "Al Bundy", while the mouse is hovering over "Peg":

And not much coding was needed for this effect. Plus, I took all of it from one of the samples, test.inplace.InplaceEditorTest.java. If you want to see the code that went into creating the in place editor functionality, which includes the selection and hovering effect (i.e., all adapted from the sample), click the link below:

InPlaceEditor.java

Join the discussion

Comments ( 6 )
  • anybridge Wednesday, August 30, 2006
    did there any opensource project based on Netbeans Visual Library 2.0 ?
  • Geertjan Wednesday, August 30, 2006
    Well, the NetBeans Mobility pack! It has recently been open sourced, and the NetBeans Visual Library comes from that pack!
  • drilona Wednesday, February 21, 2007
    al bundy måst vinn peg vans lack geting e alör vajf es e striper hu is hatt en läjter gett chuldren.
  • Hector Suarez Barenca Thursday, September 4, 2008

    Hi!, It seems It is very simple to edit a single line with Visual Library, but what about editing a multiline text with autowrap?

    Regards


  • David Kaspar Thursday, September 4, 2008

    The Visual Library does not have direct multi-line editing support but you can easily create it by copy/paste the built-in implementation of in-place editor (org.netbeans.modules.visual.action.TextFieldInplaceEditorProvider class in "api.visual" module in hg.netbeans.org/main Mercurial repository) and use JTextArea instead of JTextField. Note that you would have to extend the edited area...

    Regards, David


  • Hector Suarez Barenca Friday, September 5, 2008

    Thank you so much for your help.

    Anyway, I was researching a little bit and I found an example that helped me to implement a solution according to my needs.

    Why do they not include a multiline label widget in the Visual Library??????????

    I hope this could help others, because in my case It took me some time to find something simple and adapt it.

    Here you have the adaptation I did for my needs:

    http://barenka.blogspot.com/2008/09/visual-library-and-multiline-label.html

    Thanks a lot.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.