
Hi
I am using NetBeans IDE for developing application for java(Swings). And i am using MySQL as backend database.
My Problem is I have created JFrame form in NetBeans and i have inculded label in which i am loading photo.
BufferedImage image=null;
JFileChooser chooser = new JFileChooser();
chooser.setAcceptAllFileFilterUsed(false);
int retVal = chooser.showOpenDialog(this);
if (retVal == JFileChooser.APPROVE_OPTION) {
File myFile = chooser.getSelectedFile();
try {
image = ImageIO.read(myFile);
try
{
lblPhoto.setIcon(new ImageIcon(image));
}
catch(Exception e)
{
JOptionPane.showMessageDialog(this, "Select picture format only(JPEG,PNG,BMP,GIF): ");
}
path=myFile.getAbsolutePath();
}
catch(Exception e) {
JOptionPane.showMessageDialog(this, "MemberMasterGUI.browsePhoto: " + e.getMessage());
}
}
Here I'll get path of the photo in local machine in variable "path" . My question is how can i load this to the server machine so that this photo photo can be accessed in all of the machines from server side.
Should i have to wrirte socket program for thjis. If yes how to write it. Otherwise what is the solution to this. Please someone help me to do this.
Thanks a lot.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.