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 repres
You might look into metaphase editor, "A WYSIWYG HTML Editor Component for use in Java Applications." It's based on Charles Bell's HTMLDocumentEditor.
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);
}