Results 1 to 5 of 5
- 02-21-2010, 04:03 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
- 02-21-2010, 04:06 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 02-21-2010, 04:13 PM #3
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
i hav tried this but thr is not network button in thisJava Code:import java.lang.*; import java.io.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.event.*; import javax.swing.*; import javax.swing.filechooser.*; import java.io.*; import java.net.*; class BR { String InputFilePath=""; JTextField txtPath=new JTextField(""); ServerSocket ss; Socket s; BR() { txtPath.setBounds(50,15,400,20); txtPath.setEditable(false); try { //Create server socket ServerSocket ss = new ServerSocket(888); //connect to its client socket Socket s = ss.accept(); System.out.println("Connection established"); JFileChooser tFileChooser=new JFileChooser(); tFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); int tResult=tFileChooser.showOpenDialog(new JFrame()); if(tResult==JFileChooser.APPROVE_OPTION) { InputFilePath=tFileChooser.getSelectedFile().getPath(); //txtPath.setText(InputFilePath); //PGM tpgm=new PGM(); //tpgm.setFilePath(InputFilePath); //tpgm.readImage(); //pbInput.setImage(tpgm.getBufferedImage()); } ss.close(); s.close(); }catch(Exception e){} } public static void main(String args[]) { BR b= new BR(); } }
- 02-21-2010, 04:25 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
Get rid of all that socket stuff, display your JFileChooser again and press the 'up directory' button a couple of times; you'll see a 'network' button/folder; press it and see for yourself.
kind regards,
Jos
- 02-21-2010, 04:36 PM #5
Member
- Join Date
- Feb 2010
- Posts
- 19
- Rep Power
- 0
Similar Threads
-
Accessing a remote Microsoft Access database
By ajeeb in forum JDBCReplies: 3Last Post: 12-01-2011, 06:40 AM -
Remote deploy and remote work with JBoss AS
By chalda in forum EclipseReplies: 2Last Post: 03-08-2010, 11:17 AM -
: Accessing remote directory???
By vaskarbasak in forum AWT / SwingReplies: 3Last Post: 10-15-2009, 08:19 AM -
Accessing Remote Serial Port
By ali_sakar in forum New To JavaReplies: 0Last Post: 03-23-2009, 11:51 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks