ÇóÖú£ºÇëÎÊÓÐûÓÐʲôjava¿ªÔ´×é¼þÄܽ«ÍøÒ³×ª³ÉͼƬ£¿
¸÷λ¸ßÊÖ£¬ÇëÎÊÓÐûÓÐʲôjava¿ªÔ´×é¼þÄܹ»ÊµÏÖ½«IEä¯ÀÀÆ÷´ò¿ªµÄÍøÒ³×ª»»ÎªÍ¼Æ¬£¿£¿£¿£¿
he Flying Saucer Project
An XML/XHTML/CSS 2.1 Renderer
https://xhtmlrenderer.dev.java.net/
Rendering to an Image
You can render from a document directly to an image format of your choice using org.xhtmlrenderer.simple.ImageRenderer. To use ImageRenderer, just call ImageRenderer.renderToImage(url, path, width), or one of the overloaded versions of the method. You must specify either a width or a width and a height for the image if you like; if height is not specified, it's determined based on the content of the document. renderToImage() creates the document, writes it out to the given path, and returns a java.awt.image.BufferedImage which you can further manipulate—for example, scale and re-save or save in multiple image formats. Here's a simple sample rendering the contents of the http://www.w3c.org homepage:
Java code:
String address = "http://www.w3.org/";
// render
try {
BufferedImage buff = null;
buff = Graphics2DRenderer.renderToImage(address, "w3c-homepage.png", 1024);
} catch (IOException e) {
e.printStackTrace();
}
That's it. You can use Java's ImageIO class to write the image out in different formats; it supports writing most image fo
Ïà¹ØÎÊ´ð£º
ÎÊÌâÃèÊö£ºÐ´ÈÕÖ¾¹¦ÄÜ£¬Ð´ºÃµÄдÈÕÖ¾·þÎñ£¬ÆäËûÓû§Í¨¹ýhttpµ÷Ó÷þÎñ£¬´«Èë²ÎÊý£¬È»ºó¼Ç¼ÈÕÖ¾£¬
ÎҵķþÎñ¸ÃÔõôд£¬ ±ðÈËÔõôͨ¹ýhttpµ÷ÓÃÎҵķþÎñ£¬ÎÒÓÃwebserviceдºÃÁËÒ»¸ö£¬¿ÉÊDz¢·¢ÓÐÉÏÏߣ¬Ïë¸ÄÓ ......
import java.sql.Connection;
import java.sql.Date;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class QueryTest&n ......
ÔõôÔÚ¿ØÖÆÌ¨ÖÐÊäÈëÀàËÆÏÂÃæµÄÐÅÏ¢£º
s1234 50
s1235 80
s1234 90
s1234 40
s1236 90
ÿµ±»Ø³µÊ± ......
ÎÒ¶¨ÒåÁËÒ»¸öJRadioButtonNanµÄµ¥Ñ¡°´Å¥£¬Èç¹ûÔÚÎÒÑ¡ÔñÁËÕâ¸ö°´Å¥ºóÏëµã»÷ÖØÖÃÈÃÕâ¸ö°´Å¥´¦ÓÚδѡÔñµÄ״̬¸ÃÔõô×öÄØ£¿Çë¸ßÊÖÖ¸½Ì
jRadioButton.setSelected(false);
²»ÖªµÀÄãÊÇʲôÒâ˼
Õâ¸öÊDz»Ñ¡Ôñ״̬ÁË
Î ......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......