image save to folder in java

Ads
 

image save to folder in java

Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog is open select any image

i want to store that selected image into specified folder and that path stored into database, for furhter retrivation.

Please guide me to overcome from that problem

Thanks and Regrads

Pushpa sheela

View Answers

July 20, 2012 at 3:43 PM

ImageIcon ic=(ImageIcon)PhotoLabel.getIcon();
OutputStream out = null;
int size=0;
try {
out = new FileOutputStream("c:/Photos/"+AdmissionNoText.getText()+".jpg");

} catch (FileNotFoundException ex) {
Logger.getLogger(StudentDataMaster.class.getName()).log(Level.SEVERE, null, ex);
}
byte[] b = new byte[size];
try { 
out.write(b);
ImageIO.write(image, "jpg", out);
} catch (Exception ex) {
Logger.getLogger(StudentDataMaster.class.getName()).log(Level.SEVERE, null, ex);
}

Ads









Related Tutorials/Questions & Answers:
image save to folder in java
image save to folder in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box to select image, it will work properly i.e on button click open dialog
Java- Save Image into project folder in web application
Java- Save Image into project folder in web application  I have a requirement of saving the image into project folder .. which is a web application... want to save the image..when I am trying to create empty folder and get
Advertisements
Full path of image to save it in a folder
Full path of image to save it in a folder  Sir ,I am trying to upload... to find that image path &upload it as well. I am just a beginner in jsp... in the local context of your project, then you may first create a folder under WEB
i want to save image on server folder. and i want to save URL of this folder and name of image in database
i want to save image on server folder. and i want to save URL of this folder and name of image in database  hi i want to save image on server folder. and i want to save URL of this folder and name of image in database.on click
Folder in Java.
Folder in Java.  I have any problem how to make Folder in java program? Can Anybody help me in this part
save the uploading image with user specified name
save the uploading image with user specified name  My form consists of a textbox and an upload image with submit button.When i submit the form I want to save the uploaded image in a folder with user specfied name
save the uploading image with user specified name
save the uploading image with user specified name  My form consists of a textbox and an upload image with submit button.When i submit the form I want to save the uploaded image in a folder with user specfied name
Image name,image path into database and image into folder using jsp
Image name,image path into database and image into folder using jsp  How to insert image path and image name into oracle database and image into folder using jsp
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
How to save image on the server by applet
How to save image on the server by applet  HI, in my project I am... If user want to export this chart as GIF format then this chart should be save as a gif image on the server directory. Can any Body help me how can I do it Thanks
Jmagick write image to a specific folder
and save the resized images to the another location. for example : get an image to resize from c:\myDirectory\images and save the resized image to c:\myDirectory... to save the resized image to a specific location try{ String path
image upload in webapp/upload folder
image upload in webapp/upload folder  sir i want to store upload image in my project directory WebApp/Upload_image/ pls send the jsp servlet code when i upload the image one error found "system cannot found the specified path
Java lock file or folder.
Java lock file or folder.  Is it possible to create a desktop application to lock or encrypt file or folder in windows by using java code?? if possible can provide some reference?? because i can't find it... thanks
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  How to copy an image from one folder to another folder using jsp
Save profile and image to mysql database, and view the image in another jsp page
Save profile and image to mysql database, and view the image in another jsp page  Pls. need help in saving the profile info with the image in mysql database.. some basic code pls in jsp... thanks in advance
java program to copy the contents of one folder to another folder
java program to copy the contents of one folder to another folder  java program to copy the contents of one folder to another folder   Have a look at the following link: Java Copy one folder to another
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  ... be in my image folder...so,How to copy an jpeg image from one folder to other folder using jsp or servlet
Record and Save Video using Java
Record and Save Video using Java  How to record video(webcam) and save it using Java.?? Its really urgent
ModuleNotFoundError: No module named 'django-random-image-from-folder'
ModuleNotFoundError: No module named 'django-random-image-from-folder' ...: ModuleNotFoundError: No module named 'django-random-image-from-folder' How to remove the ModuleNotFoundError: No module named 'django-random-image-from-folder' error
ModuleNotFoundError: No module named 'django-random-image-from-folder'
ModuleNotFoundError: No module named 'django-random-image-from-folder' ...: ModuleNotFoundError: No module named 'django-random-image-from-folder' How to remove the ModuleNotFoundError: No module named 'django-random-image-from-folder' error
How to save image after edit in php
How to save image after edit in php  Hello, I have create a simple image editor with the effected of brightness, contrast, and desaturat etc. I have... successfully but i don't know how to replace orignal image with the effects. please
Insert image from user using and save in database
Insert image from user using and save in database  when i am trying to upload a image from user and trying to save into oracle9i database...;%@ page language="java" %> <HTML> <HEAD><TITLE>Display file
how to store image in folder and stored image path in mysql database using JSP
how to store image in folder and stored image path in mysql database using JSP  how to store image in folder and stored image path in mysql database using JSP
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
image upload in java
image upload in java  Hi, I am working with java. In my application i want to give facility to user to add and change image. I use open dialog box... select any image i want to store that selected image into specified folder
how to backup files and folder with Java
how to backup files and folder with Java  Does anyone know to create a backup with java?. backup files and folders from my computer to an external...:\\Documents and Settings\\bharat\\Desktop\\bipul\\New Folder\\TableExample.java
How can store image in server folder when deployed with a .war file?
How can store image in server folder when deployed with a .war file?  Hi all; When I am using application.getRealPath() , it return null when deployed with a .war file and when I use hard code it shows syntax error or path
How to access the image file from project folder itself while writing to pdf using itext?
How to access the image file from project folder itself while writing to pdf using itext?  I am writing a pdf using itext where i add a image... to search for the image in the domain folder of the glassfish location.But i want
why java file save as its class name
why java file save as its class name  hi,this is subbareddy vajrala.my doubt is why java files save as its class names
how to save a gui form in core java
how to save a gui form in core java  please help me i am java beginner how to save a jframe containing jtable and panels in java thank you
Upload Image and save in database using jsp-servlet mvc
Upload Image and save in database using jsp-servlet mvc  Here is my...;/TD> <td><input type="file" name="Image" size="20" value="">...="file" name="Image" size="20" value=""></TD> </tr> <tr>

Ads