Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java thread: Fw: [beginning_java]how to show image (JTextPane) or in (JTextArea)


Message #1 by "Rehman Mansoor" <hiya@s...> on Mon, 7 Jan 2002 19:42:19 +0500
This is a multi-part message in MIME format.

------=_NextPart_000_0012_01C197B3.6B0E1630
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable


----- Original Message -----
From: Rehman Mansoor
To: Beginning Java
Sent: Sunday, January 06, 2002 12:50 PM
Subject: [beginning_java]how to show image (JTextPane) or in (JTextArea)


Hi all
I've a problem of of taking input as an image from FileDialog and pass 
it to either in (JTextPane) or in (JTextArea) to show in the JFrame .Pls 
let me know how to show
image in these JComponents .Below is a sample image object.

FileDialog fd =3D new FileDialog(frm1,"OPEN",FileDialog.LOAD);
fd.setVisible(true);
String dir=3D fd.getDirectory();
String file=3D fd.getFile();

Toolkit toolkit =3D Toolkit.getDefaultToolkit();
 Image image1 =3D toolkit.getImage(dir+""+file);

//JTextPane area =3D new JTextPane();
//JTextArea area1=3D new JTextArea();




  Return to Index