当前位置: 首页>>代码示例>>Java>>正文


Java BasicFileChooserUI类代码示例

本文整理汇总了Java中javax.swing.plaf.basic.BasicFileChooserUI的典型用法代码示例。如果您正苦于以下问题:Java BasicFileChooserUI类的具体用法?Java BasicFileChooserUI怎么用?Java BasicFileChooserUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BasicFileChooserUI类属于javax.swing.plaf.basic包,在下文中一共展示了BasicFileChooserUI类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
public void actionPerformed(ActionEvent evt) {
    Object src = evt.getSource();
    String cmd = evt.getActionCommand();

    if (src == backButton) {
        back();
    } else if (src == nextButton) {
        FileChooserUI ui = chooser.getUI();
        if (ui instanceof BasicFileChooserUI) {
            // Workaround for bug 4528663. This is necessary to
            // pick up the contents of the file chooser text field.
            // This will trigger an APPROVE_SELECTION action.
            ((BasicFileChooserUI) ui).getApproveSelectionAction().
                    actionPerformed(null);
        } else {
            next();
        }
    } else if (src == closeButton) {
        close();
    } else if (APPROVE_SELECTION.equals(cmd)) {
        next();
    } else if (CANCEL_SELECTION.equals(cmd)) {
        close();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:FileChooserDemo.java

示例2: cleanField

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
private void cleanField()
{
    FileChooserUI myUi = getUI();
    if (myUi instanceof BasicFileChooserUI) {
        BasicFileChooserUI mui = (BasicFileChooserUI) myUi;
        mui.setFileName("");
    }
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:9,代码来源:OpenProject.java

示例3: setSelectedFile

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
@Override
public void setSelectedFile(File file) {
    super.setSelectedFile(file);
    FileChooserUI ui = getUI();
    if (file != null && ui instanceof BasicFileChooserUI) {
        ((BasicFileChooserUI) ui).setFileName(file.getName());
    }
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:9,代码来源:GrooveFileChooser.java

示例4: testGetUpdateUI

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
public void testGetUpdateUI() throws Exception {
    FileChooserUI ui = chooser.getUI();
    assertNotNull(ui);
    FileChooserUI customUI = new BasicFileChooserUI(chooser);
    chooser.setUI(customUI);
    assertEquals(customUI, chooser.getUI());
    assertNotSame(ui, chooser.getUI());
    chooser.updateUI();
    assertNotSame(customUI, chooser.getUI());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:JFileChooserTest.java

示例5: setCurrentDirectory

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
@Override
public void setCurrentDirectory(File dir) {
	super.setCurrentDirectory(dir);
	// WindowsFileChooserUI unfortunately doesn't clear file name field!
	FileChooserUI ui = getUI();
	if (ui instanceof BasicFileChooserUI) {
		((BasicFileChooserUI)ui).setFileName(null);
	}
}
 
开发者ID:bobbylight,项目名称:ZScriptLanguageSupport,代码行数:10,代码来源:FileChooser.java

示例6: jbInit

import javax.swing.plaf.basic.BasicFileChooserUI; //导入依赖的package包/类
private void jbInit() {
    this.setResizable(false);

    Border border1 = BorderFactory.createEmptyBorder(10, 10, 0, 10);
    Border border2 = BorderFactory.createEmptyBorder(5, 10, 5, 5);
    fileChooser.setBorder(null);
    fileChooser.setControlButtonsAreShown(false);
    jPanel2.setLayout(borderLayout3);
    okB.setMaximumSize(new Dimension(100, 26));
    okB.setPreferredSize(new Dimension(100, 26));
    okB.setText(Local.getString("Save"));
    okB.addActionListener(e -> {
        okB_actionPerformed();
        if (fileChooser.getUI() instanceof BasicFileChooserUI) //Added to fix problem with export note
        //jcscoobyrs 17-Nov-2003 at 08:36:14 AM
        {//Added to fix problem with export note jcscoobyrs 17-Nov-2003 at 08:36:14 AM
            BasicFileChooserUI ui = (BasicFileChooserUI) fileChooser.getUI();//Added to fix problem with export note
            //jcscoobyrs 17-Nov-2003 at 08:36:14 AM
            ui.getApproveSelectionAction().actionPerformed(e);//Added to fix problem with export note
            //jcscoobyrs 17-Nov-2003 at 08:36:14 AM
        }//Added to fix problem with export note jcscoobyrs 17-Nov-2003 at 08:36:14 AM
    });
    this.getRootPane().setDefaultButton(okB);
    cancelB.setMaximumSize(new Dimension(100, 26));
    cancelB.setPreferredSize(new Dimension(100, 26));
    cancelB.setText(Local.getString("Cancel"));
    cancelB.addActionListener(e -> cancelB_actionPerformed());
    jPanel3.setLayout(flowLayout1);
    flowLayout1.setAlignment(FlowLayout.RIGHT);
    borderLayout3.setHgap(5);
    borderLayout3.setVgap(5);
    jPanel2.setBorder(border1);
    jPanel3.setBorder(border2);
    jPanel1.setLayout(borderLayout2);
    jLabel1.setMaximumSize(new Dimension(155, 16));
    jLabel1.setPreferredSize(new Dimension(80, 16));
    jLabel1.setText(Local.getString("Encoding") + ":");
    jPanel4.setLayout(gridLayout1);
    splitChB.setText(Local.getString("Split notes into separate files"));
    gridLayout1.setColumns(1);
    gridLayout1.setRows(3);
    titlesAsHeadersChB.setText(Local.getString("Notes titles as headers"));
    this.getContentPane().add(jPanel2, BorderLayout.CENTER);
    jPanel2.add(jPanel4, BorderLayout.SOUTH);
    jPanel4.add(jPanel1, null);
    jPanel1.add(encCB, BorderLayout.CENTER);
    jPanel1.add(jLabel1, BorderLayout.WEST);
    jPanel4.add(splitChB, null);
    jPanel2.add(fileChooser, BorderLayout.NORTH);
    this.getContentPane().add(jPanel3, BorderLayout.SOUTH);
    jPanel3.add(okB, null);
    jPanel3.add(cancelB, null);
    jPanel4.add(titlesAsHeadersChB, null);
}
 
开发者ID:cst316,项目名称:spring16project-Team-Laredo,代码行数:55,代码来源:ProjectExportDialog.java


注:本文中的javax.swing.plaf.basic.BasicFileChooserUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。