如何在页面上画出下图 每行N的数理是2的N次方。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 jfreechart不知道能不能画这么高级的图哇。算法倒是简单。 有规律没?没规律就估算个位置画啊。BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);Graphics g = image.getGraphics();g.setColor(Color.black);g.drawRect(0, 0, width, height);g.drawString(str,x, y);......g.dispose();response.setContentType("image/jpeg");out.clear();out = pageContext.pushBody();OutputStream strm = response.getOutputStream();ImageIO.write(image, "jpeg", strm);strm.close(); 1 JFreeChart肯定不能。2 每行显示的数据只是一个算法的问题。3 图形显示BufferedImage,但显示的位置比较麻烦4 能否从TreeNode得到点启发? 没考虑溢出,只用了int。public static void main(String[] args) { for(int i=0;i<10;i++){ if(i%2!=0){ for(int j=0;j<Math.pow(2,i);j++){ System.out.print((int)Math.pow(2,i)+j+" "); } }else{ for(int j=1;j<=Math.pow(2,i);j++){ System.out.print((int)Math.pow(2,i+1)-j+" "); } } System.out.println(); } } struts2 导出excel并保存到WebRoot下 java页面导出下载时以表单方式提交,后台执行了两次 分析温州政务网信息公开信息公开目录各导航的链接地址 struts2 session丢失的问题 这样就可以防御JSP的sql注入吗? 求助!!!!!!struts传值问题 一关于hibernate查询的问题,在线等! 如何获取目录的大小? 怎样向oracle Long字段插入数据(急) 请高手指点 请问:如何让jsp不在前台显示出现,感谢 logout退出后,再点击“后退”按钮算一个请求吗?
没规律就估算个位置画啊。
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setColor(Color.black);
g.drawRect(0, 0, width, height);
g.drawString(str,x, y);
......
g.dispose();
response.setContentType("image/jpeg");
out.clear();
out = pageContext.pushBody();
OutputStream strm = response.getOutputStream();
ImageIO.write(image, "jpeg", strm);
strm.close();
2 每行显示的数据只是一个算法的问题。
3 图形显示BufferedImage,但显示的位置比较麻烦
4 能否从TreeNode得到点启发?
if(i%2!=0){
for(int j=0;j<Math.pow(2,i);j++){
System.out.print((int)Math.pow(2,i)+j+" ");
}
}else{
for(int j=1;j<=Math.pow(2,i);j++){
System.out.print((int)Math.pow(2,i+1)-j+" ");
}
}
System.out.println();
}
}