帮你查了一下他的api首先class叫JGraph所以是org.jgraph.JGraph 他有getImage方法但是不是静态的需要首先创建一个JGraph对象 然后我想你可以用BufferedImage img=graph.getImage(graph.getBackground(),1 );参数类型应该是对的 附上方法的javadoc public BufferedImage getImage(Color bg, int inset)Returns a BufferedImage for the graph using inset as an empty border around the cells of the graph. If bg is null then a transparent background is applied to the image, else the background is filled with the bg color. Therefore, one should only use a null background if the fileformat support transparency, eg. GIF and PNG. For JPG, you can use Color.WHITE for example. Returns: Returns an image of the graph.
如果有这个方法就IMPORT导入就可以了。我手头没这个包的资料
你说的org.jgraph.graph,graph首字母是小写的应该是个包名而不是类名,所以肯定不能像你那样调用。自己去查查JGraph相关的资料吧
他有getImage方法但是不是静态的需要首先创建一个JGraph对象
然后我想你可以用BufferedImage img=graph.getImage(graph.getBackground(),1 );参数类型应该是对的
附上方法的javadoc
public BufferedImage getImage(Color bg,
int inset)Returns a BufferedImage for the graph using inset as an empty border around the cells of the graph. If bg is null then a transparent background is applied to the image, else the background is filled with the bg color. Therefore, one should only use a null background if the fileformat support transparency, eg. GIF and PNG. For JPG, you can use Color.WHITE for example. Returns:
Returns an image of the graph.