标签:
Dimension welcomeScreen=Toolkit.getDefaultToolkit().getScreenSize();
int x=(welcomeScreen.width-this.getSize().width)/2;
int y=(welcomeScreen.height-this.getSize().height)/2;
this.setBounds(x, y, 500, 400);private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jFileChooser1.setFileFilter(new FileFilter() {
@Override
public boolean accept(File f) {
return f.getName().toLowerCase().endsWith(".txt")||f.isDirectory(); //To change body of generated methods, choose Tools | Templates.
}
@Override
public String getDescription() {
return ".txt 文件"; //To change body of generated methods, choose Tools | Templates.
}
});
jFileChooser1.showOpenDialog(this);
} 标签:
原文地址:http://blog.csdn.net/sxhlovehmm/article/details/42341295