tags:

views:

43

answers:

3

Hello all

I like to build java WYSIWYG HTML to practice my or better learn Java swing all the simple swing layouts and simple components i understand , but what should i use to represent tables text place holders html graphic Div representation and so on.. they all have to have drag and drop icons that i drop to the main windows and reside it and move it for this what Java swing component shell i use?

+1  A: 

Take a look at this: http://stackoverflow.com/questions/853071/wysiwyg-text-editor-in-java

or im sorry im was miss understod , i need to build drag and drop page editor like the ones here : http://www.java4less.com/fopdesigner/fodesigner.php http://www.xslfast.com/online-help/menubar.htm or like the netbeans swing editor but much more simple
+1  A: 

Basically, to draw grids and lines, you need to draw the HTML elements graphically on one or more JPanels.

You do this by overriding the paintComponent() method with your Graphics and Graphics2D method calls.

Here's a simple example:

 public void paintComponent(Graphics g) {
    // Dynamically calculate size information
    Dimension size = getSize();
    // diameter
    int d = Math.min(size.width, size.height); 
    int x = (size.width - d)/2;
    int y = (size.height - d)/2;

    // draw circle (color already set to foreground)
    g.fillOval(x, y, d, d);
    g.setColor(Color.black);
    g.drawOval(x, y, d, d);
}
Gilbert Le Blanc
do you know good example links or source code for this?
A: 

You might look into metaphase editor, "A WYSIWYG HTML Editor Component for use in Java Applications." It's based on Charles Bell's HTMLDocumentEditor.

trashgod