I develope a applet and I want to open JFileChooser in action of one Button.
I Write his code for it in actionPerformed method:
JFileChooser fileaddress = new JFileChooser();
fileaddress.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileaddress.setDialogTitle("Open Your Files!");
int result = fileaddress.showOpenDialog(this);
if (result == JFileChooser.APPROVE_OPTION)
{
file = fileaddress.getSelectedFile();
txtaddress.setText(file.toString());
}
this open in the appletviewer in event of my button, but when i open my applet in html files,JFileChooser doesn't open in button event. what is the problem?