954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

function / methods

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

4ukh
Junior Poster in Training
70 posts since May 2008
Reputation Points: 13
Solved Threads: 1
 
sciwizeh
Posting Pro in Training
457 posts since Jun 2008
Reputation Points: 77
Solved Threads: 23
 

thanks for the help...

it seem work for me...

4ukh
Junior Poster in Training
70 posts since May 2008
Reputation Points: 13
Solved Threads: 1
 

does that mean that your problem is solved? :)
when a button is presses, i assume you do already know how actionListener works.

sciwizeh
Posting Pro in Training
457 posts since Jun 2008
Reputation Points: 77
Solved Threads: 23
 

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

4ukh
Junior Poster in Training
70 posts since May 2008
Reputation Points: 13
Solved Threads: 1
 

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

int returnVal = fc.showOpenDialog(FileChooserDemo.this);

if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
//This is where a real application would open the file.
log.append("Opening: " + file.getName() + "." + newline);
} else {
log.append("Open command cancelled by user." + newline);
}

sciwizeh
Posting Pro in Training
457 posts since Jun 2008
Reputation Points: 77
Solved Threads: 23
 

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

4ukh
Junior Poster in Training
70 posts since May 2008
Reputation Points: 13
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You