• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Building a UI Builder?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes happened that I figured out how to build a UI builder, like a jasper report or a netbeans matisse are. As harder is to implementing something like that, a builder to create UI. I´m trying to find out some infos but not found. My idea is to create for example a JForm (or something similar), create some dots (to represents rules) and a structure to drag on drop components from a palete.

A justed starded and put via code a JLabel, but not from a palete, and that label one action I can do atm is to move this component surrounding the form. I have a lot of thing to do and thinking about to create a real UI Builder. If I take something functional I can go further next step and mind what I can do with this tool.
 
Inocencio Oliveira
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did a kind of "dot grid" to represent the slots that any dragable component can be fited. Its just a start code, I will try to implement next step some way to drag component to the form. Check the code following...



Next step I will try to do something more useful.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Building a UI Builder?

a ui builder, built incorrectly, is not a good start.

class Pointer extends Canvas {

Canvas is an AWT component, and whilst the program might work OK now,
the moment you add Swing components alongside the canvas, you will have
painting problems.

http://java.sun.com/products/jfc/tsc/articles/mixing/
 
Inocencio Oliveira
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My intention is to build an UI Builder. But I have to concentrate new ideas to build further a real UI builder, but in primor state I´m doing new samples to build different stuffs, first: how to draw dots to represent some grid context, next... (I hope) how to build components at screen that are dragable and fix to scen, and so on.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must think different.

A UI builder is nothing but an application like the others. Instead of handling, let say, bank account, you'll handle "beans".

java provides a wide set of generic tools to handle beans. That's you model.

To handle a "Bean" you must put it into a "handler box". Something like a panel, with layeredpane and an opaque glasspane ( with transparent color). This will enable you to generically display beans, but catch all the click, and drag gesture, and even draw overlay.

It's the same for a Container. Except that you'll have to handle the drag and drop based on the actual layout for it. I've never seen a visual builder that can handle "generic" layouts. There is always a Handler class for every LayoutManager. Most of the difference between UI builder comes from the quality of their LayoutManager HandlerSSS

Then, at last, when you have a tree of beans, you can generate code, or XML description, to makes it possible to access the actual view at runtime.
 
reply
    Bookmark Topic Watch Topic
  • New Topic