title: Create a GUI for a maze in Java
body: <p>I need to create a maze in Java where each time (i.e. every time I run the program ) a different maze would be made . 
  The program consists of 3 levels : beginner (25 rooms) , advanced (40 rooms) and expert (60 rooms) , with players (up to 20 players) and treasures , where each player must get at least one treasure .</p>
  
  <p>I've made the logic side of the maze , meaning , I've written the maze algorithm where 
  each time the program randomly get a dot in the (x,y) plane and adds it to a graph - G=(V,E) -  where the vertices are the <code>rooms</code> , and the edges are <code>connectors</code> (Door/Wall) . </p>
  
  <p>Now my problem , is that I need to represent the maze using GUI , so I've attached the SWT from the Eclipse's site to my program , but I do not know how to use the GUI to describe the maze/graph . </p>
  
  <p>At first, I want to present to the user the maze before that game begins , meaning is , after creating the maze , before the players hit the road . </p>
  
  <p>Can you please give me a hint where or how to start ? </p>
  
  <p>the relevant classes are : </p>
  
  <pre><code>public class Room {
  
  
  
      private ArrayList&lt;Connector&gt; connectors;
      private int x;    // x coordinate of the room 
      private int y;    // y coordinate of the room 
  
  
      // constructor  
  
      Room(int xCoordinate,int yCoordinate)
      {
          //this.connectors = new HashMap&lt;String,Connector&gt;();
          this.connectors = new ArrayList&lt;Connector&gt;();
          this.x = xCoordinate;
          this.y = yCoordinate;
      }
  
      Room()
      {
          this.x = 0;
          this.y = 0;
      }
  
  
      public void addConnector(Connector connector)
  
      {
          this.connectors.add(connector);
      }
  
      /* Getters and Setters */
  
      public int getXcoordinate() 
      {
          return this.x;
      }
  
      public int getYcoordinate()
      {
          return this.y;
      }
  
      public void setXcoordinate(int newX)
      {
          this.x = newX;
      }
  
      public void setYcoordinate(int newY)
      {
          this.y = newY;
      }
  
  
  
  }
  
  
  
  
  package model;
  
  public class Door extends Connector {
  
  
      // holds private Room[] rooms = new Room[2];
  
      Door(Room room1,Room room2) 
      {
          super(room1,room2);
  
      }
  
      public Room getNextRoom(Room room) 
      {
          if(this.rooms[0].equals(room))
          {
              return this.rooms[1];
          }
          return this.rooms[0];
      }
  
  
  }
  
  
  public abstract class Connector {
  
  
      protected Room[] rooms = new Room[2];
      public abstract Room getNextRoom(Room room);
  
      public Connector(Room room1,Room room2)  // building a new connector that connects between two rooms s
      {
          rooms[0] = room1;
          rooms[1] = room2;
      }
  
      public Room getFirstRoom()
      {
          return this.rooms[0];
      }
  
      public Room getSecondRoom()
      {
          return this.rooms[1];
      }
  
  
  
  }
  </code></pre>
  
  <p>Regards,Ron</p>