943,649 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 802
  • Java RSS
Aug 17th, 2008
0

function / methods

Expand Post »
hi guys

how to achieve a goal like this in java programming:
when i click a button it prompt me a browsing window to locate some file(s) or folder(s)...
basically i need a specific function...

any help will be appreciated

best regards
Similar Threads
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
4ukh is offline Offline
70 posts
since May 2008
Aug 17th, 2008
1

Re: function / methods

Reputation Points: 73
Solved Threads: 22
Posting Pro in Training
sciwizeh is offline Offline
423 posts
since Jun 2008
Aug 17th, 2008
1

Re: function / methods

thanks for the help...

it seem work for me...
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
4ukh is offline Offline
70 posts
since May 2008
Aug 17th, 2008
0

Re: function / methods

does that mean that your problem is solved?
when a button is presses, i assume you do already know how actionListener works.
Reputation Points: 73
Solved Threads: 22
Posting Pro in Training
sciwizeh is offline Offline
423 posts
since Jun 2008
Aug 18th, 2008
0

Re: function / methods

no not yet but I'm working on it...

private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
// here i don't know how to invoke the "JFileChooser".....

}


any help....!


thank you
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
4ukh is offline Offline
70 posts
since May 2008
Aug 18th, 2008
0

Re: function / methods

did you read the sun tutorial (my first post, the JFileChooser was a link (as is this one)? it explains the usage quite thoroughly...

a quote almost but not quite 1/4 down the page
Quote originally posted by Sun Tutorail ...
java Syntax (Toggle Plain Text)
  1. int returnVal = fc.showOpenDialog(FileChooserDemo.this);
  2.  
  3. if (returnVal == JFileChooser.APPROVE_OPTION) {
  4. File file = fc.getSelectedFile();
  5. //This is where a real application would open the file.
  6. log.append("Opening: " + file.getName() + "." + newline);
  7. } else {
  8. log.append("Open command cancelled by user." + newline);
  9. }
Reputation Points: 73
Solved Threads: 22
Posting Pro in Training
sciwizeh is offline Offline
423 posts
since Jun 2008
Aug 19th, 2008
0

Re: function / methods

yes I've red that and it was quite helpful...

well im still far away form the objective which im working on... but sooner or later it will be done... yah...

thanks for the help
Reputation Points: 13
Solved Threads: 1
Junior Poster in Training
4ukh is offline Offline
70 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: objects in heap why?
Next Thread in Java Forum Timeline: java loop help?!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC