swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] Java Swarm Graphs


From: durga bhavani
Subject: Re: [Swarm-Support] Java Swarm Graphs
Date: Thu, 17 Nov 2005 14:09:08 -0800 (PST)

Hello Marcus
 
Sorry to bother you but still I am getting the Exception I tried a lot
 
 
public class SimF
 
public void Print1()
{                  
 String colors[]={"red","green","blue"};
        Graph graph1;       
 try
 {            
         graph1 = groupObserver.getgraph();
  for (int i = 1; i < 8; i++)
  {
          //System.out.println("Creating Graph Element");
          GraphElement ge = graph1.createElement ();
          ge.setLabel ("Time Step" + i);
          ge.setWidth (2);
          ge.setColor (colors[i % 3]);
       //System.out.println("For Loop");
          ge.addX$Y ((5 - i) ^ 2, 1 + i);
          ge.addX$Y (i + 9, 10 * Math.sin (Math.PI * i / 10));
         //System.out.println(value[k]);
          int t=0;
         }
        }
 catch(Exception e)
 {
  System.out.println("Exception caught because of observer"+e);
        }
}

public class GroupObserver extends SwarmImpl
public Graph graph;

public Graph getgraph()
{
 graph = new GraphImpl(getZone());
        return graph;
}
 
Public Object buildObjects
graph = new GraphImpl(getZone());
graph.setWindowTitle("Group CFL veruses Iteration");                
graph.pack();
 

Excepetion
Exception caught because of Observer java.lang.NullPointerException

Thanks a lot
Durga

"Marcus G. Daniels" <address@hidden> wrote:
durga bhavani wrote:

> It throws Exception can any one Please help m

You have tried to use the uninitialized `graph1' variable to create a
graph element before you have acquired it from the observer Swarm.

> Graph graph1;
> for (int i = 1; i < 8; i++)
> {
> System.out.println("Creating Graph Element");
> GraphElement ge = graph1.createElement ();
> try
> {
> graph1 = groupObserver.getgraph();
> }


_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


Yahoo! FareChase - Search multiple travel sites in one click.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]