Geertjan's Blog

  • January 23, 2014

Ad Designer on the NetBeans Platform (Part 1)

Geertjan Wielenga
Product Manager
Here's a new NetBeans Platform sample that puts many typical things together and gets you jump started when creating some kind of designer.

The movie above is silent. It shows how to create a new XML file of the type managed by the application. It shows you can drag items into certain regions of the visual designer, i.e., items in the Header category of the Palette can only be dropped in the top of the three widgets, items in the Body category only in the middle, etc. Then right-click anywhere to serialize into the XML file.

Source code:


Even though it's got HTML in the name, it's simply a visual designer for XML files. After that, the idea is that the XML files get converted to HTML.

Now see part 2.

Join the discussion

Comments ( 5 )
  • guest Friday, January 24, 2014

    Thanks for the post. I was just researching how to re-use the netbeans pallete and visual designer. I'm looking forward to investigating the source. I find it curious that you "export xml" every time before switching to the source tab - is there a reason the two tabs aren't always in-sync? I also notice that the user can adjust the layout in the graphical editor but the xml representation only includes width and height, nothing about vertical or horizontal positioning. This precludes round-triping from xml back to visual design - right?

    Not too different from the Swing gui designer displaying java in the source tab and gui components in the visual tab but utilizing a .form file behind the scenes.

    IReport appears to reuse the visual designer but generate (and round-trip) jrxml directly.

    Are there any other open-source re-uses of the Pallete and Visual Designer/gui builder?

  • Geertjan Friday, January 24, 2014

    Listen, it's a starting point, OK? :-) Feel free to fork it and make it do whatever you need.

  • ryan Friday, January 24, 2014

    Thank you for providing and sharing the example!

    My comments weren't meant as criticism.

    I want to do something close to what you demo'd so I'm very excited to have an example to study. Re-using the visual designer was an idea I was considering. Now I suspect its an idea I'll be prototyping. The next step for me is to figure out why java.net hates my svn - but thats not your problem. Keep up the great work!

    svn: E175002: Unexpected HTTP status 500 'Internal Server Error' on '/projects/nb-api-samples/sources/api-samples/show/versions/7.4/misc/GraphicHTMLEditor%3Frev


  • Geertjan Friday, January 24, 2014

    Great to hear. And I added automatic synchronization, and checked it in, at least, from the view to the source, not the other way round yet. Working on the x and y now. Also, make sure to sign up for this book, where this precise topic will be addressed too: https://leanpub.com/nbp4beginners

  • Geertjan Friday, January 24, 2014

    OK, x and y are now added. Now need to find a way to update the x and y after a move and the width and height after a resize.

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