Question : how to implement the screen which can be in form of grid lines  in swings

Hi,
I am implementing the one desktop application.In that i need to implement one desktop screen  which can be in form of grid lines. I attached  the screen here.So how can i implement the screen design in swing

thanks in advance,
Prasad.
 
screen for grid line design
329930
 

Answer : how to implement the screen which can be in form of grid lines  in swings

I've attached a basic example. Is this what you want?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class GridPanelLauncher extends JFrame {

    public class LocalGridPanel extends JPanel {

	private static final int X_GRID_DISTANCE = 20;
	private static final int Y_GRID_DISTANCE = 20;

	@Override
	protected void paintComponent( Graphics g ) {
	    super.paintComponent( g );

	    Graphics2D g2d = (Graphics2D) g.create( );

	    g2d.setColor( Color.LIGHT_GRAY );
	    g2d.setStroke( new BasicStroke( 1 ) );

	    // Draw vertical grid lines
	    for (int x = 0; x < this.getWidth( ); x += X_GRID_DISTANCE) {
		g2d.drawLine( x, 0, x, this.getHeight( ) );
	    }

	    // Draw horizontal grid lines
	    for (int y = 0; y < this.getHeight( ); y += Y_GRID_DISTANCE) {
		g2d.drawLine( 0, y, this.getWidth( ), y );
	    }

	    g2d.dispose( );
	}
    }

    public GridPanelLauncher() {
	JPanel panel = new LocalGridPanel( );
	getContentPane( ).add( panel );
    }

    private static void createAndShowGUI() {
	JFrame mainFrame = new GridPanelLauncher( );
	mainFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	mainFrame.setSize( 800, 610 );
	mainFrame.setVisible( true );
    }

    public static void main( String[] args ) {
	Runnable doCreateAndShowGUI = new Runnable( ) {
	    public void run() {
		createAndShowGUI( );
	    }
	};

	SwingUtilities.invokeLater( doCreateAndShowGUI );
    }
}
Random Solutions  
 
programming4us programming4us