AWT is actually not the preferred way to write Java GUI applications these days. The sun seems to have basically abandoned it. The two most popular options are Swing and SWT . Therefore, I think that they did not develop the API very widely to add modern features. (err to answer your question: No, you don't seem to be able to do this with AWT)
The advantage of Swing is that it really works with recording once, and everywhere, it can look the same. There are Look and Feels who are trying to make Swing look native, some are better than others (Mac is not scary, Windows is fine, GTK is not). However, if you want the app to really look and act EXACTLY the same everywhere, Swing lets you do it. In addition, it comes without a box without any additional libraries. Performance is low.
Swing JFileChooser lets you do what you want. Subclass FileFilter and call setFileFilter on JFileChooser .
SWT takes a write once in the opposite direction in the opposite direction. You still have one code base with which you write, but in fact it uses its own widgets on each platform, so it usually looks like a native application (not perfect everywhere, but still impressive). It is fast and fairly reliable in my experience. Eclipse (and other high-profile software) uses SWT, so it is quite actively used. But this requires platform-specific JARs and DLLs.
source share