當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。