Hello anyone!

I'm having serious problems with a school project. I need to know some things and hopefully you can help

1st question -------------------

I want to force the user to be able to ONLY open files of a certain extension, such as mp3, or avi, etc. How do I do that?

How can I have that to show in the open file dialog box? The default is *.* all files..... please help!


if (ae.getSource()==abrir)
FileDialog file = new FileDialog (this, "Abrir Ficheiro...", FileDialog.LOAD);
file.show ();
String fileName = file.getDirectory () + file.getFile ();
System.out.println (fileName);


It works this way if I select the correct extension, but I guess you understand what i want to do...


2nd question

I have some button created, but when I add an image icon to the button, it appears tiny in the applet, and you can't see the image.

abrir = new JButton(new ImageIcon("open.gif"));

Shouldn't it show up correctly?


If you can help I'll post more questions... I've been to many forums, irc, and no one seems to be helping....

Thanks for any hlp you might provide!