0

Hi,

I don't really have a programming issue rather a artistic issue.

Look at the following code of the front view an unfinished building. I'm trying to add a side view to the right or left. I just can wrap my mind on how it is supposed to look.

public static void main(String[] args) {

        JFrame frame = new JFrame("House");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(1280, 768);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }


public void paint (Graphics g)
    {
        
        centrebuilding(g);
        sidebuilding1(g);
        sidebuilding2(g);




public void centrebuilding (Graphics g)
    {
        g.setColor(new Color(173, 255, 47)); //Centre Structure
        g.fillRect (450,619,300,30);
        g.fillRect (450,584,300,30);
        g.fillRect (450,549,300,30);
		g.fillRect (450,514,300,30);
		g.fillRect (450,479,300,30);
		g.fillRect (450,444,300,30);
		g.fillRect (450,409,300,30);

		g.setColor(new Color(218, 165, 32)); //Roof

		int x[] = {450,600,750};
        int y[] = {406,350,406};
        g.fillPolygon(x,y,3);

    }

    public void sidebuilding1 (Graphics g)
    {
    	      g.setColor(new Color(173, 255, 47));
    	      g.fillRect (752,619,200,30); //Right Side
              g.fillRect (752,584,200,30);
              g.fillRect (752,549,200,30);
		g.fillRect (752,514,200,30);
		g.fillRect (752,479,200,30);
		g.fillRect (752,444,200,30);

		g.setColor(new Color(218, 165, 32)); //Roof
		int x[] = {954,752,752};
        int y[] = {439,410,439};
        g.fillPolygon(x,y,3);



    }

    public void sidebuilding2 (Graphics g)
    {
		g.setColor(new Color(173, 255, 47));
    	        g.fillRect (248,619,200,30); //Left Side
                g.fillRect (248,584,200,30);
                g.fillRect (248,549,200,30);
		g.fillRect (248,514,200,30);
		g.fillRect (248,479,200,30);
		g.fillRect (248,444,200,30);

		g.setColor(new Color(218, 165, 32)); //Roof

		int x[] = {245,448,448};
        int y[] = {439,407,439};
        g.fillPolygon(x,y,3);


    }
1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by tnimblett
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.