import java.awt.Color; import javax.swing.ImageIcon; import javax.swing.JApplet; import javax.swing.JButton; public class yahoo extends JApplet { private JButton button,picture; public void init() { setBackground(Color.PINK); button = new JButton("clilck here"); ImageIcon pic = new ImageIcon("flower.jpg"); picture=new JButton(pic); add(button); add(picture); } }
private transient java.sql.Blob psPic; public void blob2file() { if (this.psPic==null) { return; } try { long size = this.psPic.length(); byte[] buffer = this.psPic.getBytes(1, (int) size); String urlTemp = "C:/"; String savedFilename = "temp.jpg";//image source in blob is jpg. String savedFullPathFilename = urlTemp + File.separatorChar + savedFilename; File file = new File(savedFullPathFilename); if (file.exists()) { file.delete(); } LogUtil.mainLog.debug("Start write with OutputStream."); OutputStream ost = new FileOutputStream(file); ost.write(buffer); ost.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง