I am trying to display a simple JFileChooser that has no Titlebar. Below is the example code:
package ca.customfilepicker.main;
import java.awt.Component;
import java.awt.HeadlessException;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
class CustomFileChooser
{
public static void main(String args[]) {
JFileChooser chooser = new JFileChooser() {
@Override
protected JDialog createDialog(Component parent) throws HeadlessException {
JDialog diag = super.createDialog(parent);
//diag.setUndecorated(true);
return diag;
}
};
chooser.setBorder(BorderFactory.createTitledBorder("Open"));
chooser.showOpenDialog(null);
}
}
So essentially I want the Border I set to be the top level Title bar. Example image:
So far I have had zero luck achieving this, nor found any others looking for a similar appearance. Appreciate the help! Cheers