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


Python JFileChooser.showDialog方法代码示例

本文整理汇总了Python中javax.swing.JFileChooser.showDialog方法的典型用法代码示例。如果您正苦于以下问题:Python JFileChooser.showDialog方法的具体用法?Python JFileChooser.showDialog怎么用?Python JFileChooser.showDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JFileChooser的用法示例。


在下文中一共展示了JFileChooser.showDialog方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: chooseFile

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def chooseFile(self, event):
     chooseFile = JFileChooser()
     filter = FileNameExtensionFilter("c files", ["c"])
     chooseFile.addChoosableFileFilter(filter)
     chooseFile.showDialog(self.uploadPanel, "Choose File")
     chosenFile = chooseFile.getSelectedFile()
     self.uploadTextField.text = str(chosenFile)
开发者ID:LucaBongiorni,项目名称:Directory-File-Listing-Parser-Importer,代码行数:9,代码来源:Directory-File-Listing-Parser-Importer.py

示例2: set_plugin_loc

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def set_plugin_loc(self, event):
     """Attempts to load plugins from a specified location"""
     if self.config['Plugin Folder'] is not None:
         choose_plugin_location = JFileChooser(self.config['Plugin Folder'])
     else:
         choose_plugin_location = JFileChooser()
     choose_plugin_location.setFileSelectionMode(
         JFileChooser.DIRECTORIES_ONLY)
     choose_plugin_location.showDialog(self.tab, "Choose Folder")
     chosen_folder = choose_plugin_location.getSelectedFile()
     self.config['Plugin Folder'] = chosen_folder.getAbsolutePath()
     self._load_plugins(self.config['Plugin Folder'])
开发者ID:aur3lius-dev,项目名称:SpyDir,代码行数:14,代码来源:SpyDir.py

示例3: get_source_input

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def get_source_input(self, event):
     """Sets the source dir/file for parsing"""
     source_chooser = JFileChooser()
     source_chooser.setFileSelectionMode(
         JFileChooser.FILES_AND_DIRECTORIES)
     source_chooser.showDialog(self.tab, "Choose Source Location")
     chosen_source = source_chooser.getSelectedFile()
     try:
         self.source_input = chosen_source.getAbsolutePath()
     except AttributeError:
         pass
     if self.source_input is not None:
         self.update_scroll("[*] Source location: %s" % self.source_input)
         self.curr_conf.setText(self.source_input)
开发者ID:aur3lius-dev,项目名称:SpyDir,代码行数:16,代码来源:SpyDir.py

示例4: getFilePath

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def getFilePath(self):
     chooseFile = JFileChooser()
     panel = JPanel()
     ret = chooseFile.showDialog(panel, "Choose output file (*.msc)")
     if ret == JFileChooser.APPROVE_OPTION: 
       file=chooseFile.getSelectedFile()
     return file 
开发者ID:0x24bin,项目名称:BurpSuite,代码行数:9,代码来源:SequenceGenerator.py

示例5: openFile

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def openFile(self, event):
        '''
        1. Check if current file in text area has unsaved changes
            1.1 Prompt user for file saving
                1.1.1 Save file
        2. Display browser for user to choose file
        3. Load file in text area
        '''
        self.consoleController.addText("NammuController: Opening file...")

        self.handleUnsaved()

        fileChooser = JFileChooser()
        filter = FileNameExtensionFilter("ATF files", ["atf"])
        fileChooser.setFileFilter(filter)
        status = fileChooser.showDialog(self.view, "Choose file")

        if status == JFileChooser.APPROVE_OPTION:
            atfFile = fileChooser.getSelectedFile()
            filename = atfFile.getCanonicalPath()
            atfText = self.readTextFile(filename)
            self.currentFilename = atfFile.getCanonicalPath()
            self.atfAreaController.setAtfAreaText(atfText)

        #TODO: Else, prompt user to choose again before closing

        self.consoleController.addText(" OK\n")
开发者ID:jenshnielsen,项目名称:nammu,代码行数:29,代码来源:NammuController.py

示例6: onOpenFolder

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def onOpenFolder(self, event):
     chooseFile = JFileChooser()
     chooseFile.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
     ret = chooseFile.showDialog(self, "Choose folder")
     if ret == JFileChooser.APPROVE_OPTION:
         self.faile= chooseFile.getSelectedFile()
         self.cbOutDir.addItem(self.faile.getPath())
         self.cbOutDir.selectedItem= self.faile.getPath()
开发者ID:fran-jo,项目名称:SimuGUI,代码行数:10,代码来源:meegui_jy.py

示例7: onClick

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def onClick(self, e):
     chooseFile = JFileChooser()
     filter = FileNameExtensionFilter("c files", ["c"])
     chooseFile.addChoosableFileFilter(filter)
     ret = chooseFile.showDialog(self.panel, "Choose file")
     if ret == JFileChooser.APPROVE_OPTION:
           file = chooseFile.getSelectedFile()
           
           print file
开发者ID:fran-jo,项目名称:SimuGUI,代码行数:11,代码来源:demo.py

示例8: onClick

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def onClick(self, e):

        chooseFile = JFileChooser()
        filter = FileNameExtensionFilter("SQLite", ["sqlite"])
        chooseFile.addChoosableFileFilter(filter)

        ret = chooseFile.showDialog(self.panel, "Select SQLite")

        if ret == JFileChooser.APPROVE_OPTION:
            file = chooseFile.getSelectedFile()
            text = self.readPath(file)
            self.area.setText(text)
开发者ID:CarlosLannister,项目名称:AutopsyModules,代码行数:14,代码来源:LowHangingFruit.py

示例9: onClick

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def onClick(self, e):

       chooseFile = JFileChooser()
       filter = FileNameExtensionFilter("SQLite", ["sqlite"])
       chooseFile.addChoosableFileFilter(filter)

       ret = chooseFile.showDialog(self.panel0, "Select SQLite")

       if ret == JFileChooser.APPROVE_OPTION:
           file = chooseFile.getSelectedFile()
           Canonical_file = file.getCanonicalPath()
           #text = self.readPath(file)
           self.local_settings.setSetting('ExecFile', Canonical_file)
           self.Program_Executable_TF.setText(Canonical_file)
开发者ID:markmckinnon,项目名称:Autopsy-Plugins,代码行数:16,代码来源:Gui_Test_With_Settings.py

示例10: Find_Plaso_File

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def Find_Plaso_File(self, e):

       chooseFile = JFileChooser()
       filter = FileNameExtensionFilter("All", ["*.*"])
       chooseFile.addChoosableFileFilter(filter)

       ret = chooseFile.showDialog(self.panel0, "Find Plaso Storage File")

       if ret == JFileChooser.APPROVE_OPTION:
           file = chooseFile.getSelectedFile()
           Canonical_file = file.getCanonicalPath()
           #text = self.readPath(file)
           self.local_settings.setSetting('Plaso_Storage_File', Canonical_file)
           self.Plaso_Storage_File_TF.setText(Canonical_file)
开发者ID:markmckinnon,项目名称:Autopsy-Plugins,代码行数:16,代码来源:Plaso_Import.py

示例11: Find_Dir

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def Find_Dir(self, e):

       chooseFile = JFileChooser()
       filter = FileNameExtensionFilter("All", ["*.*"])
       chooseFile.addChoosableFileFilter(filter)
       #chooseFile.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)

       ret = chooseFile.showDialog(self.panel0, "Find Volatility Directory")

       if ret == JFileChooser.APPROVE_OPTION:
           file = chooseFile.getSelectedFile()
           Canonical_file = file.getCanonicalPath()
           #text = self.readPath(file)
           self.local_settings.setSetting('Volatility_Directory', Canonical_file)
           self.Program_Executable_TF.setText(Canonical_file)
开发者ID:markmckinnon,项目名称:Autopsy-Plugins,代码行数:17,代码来源:Volatility.py

示例12: onOpenFile

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def onOpenFile(self, event):
     ''' remember to change the path'''
     chooseFile = JFileChooser()
     chooseFile.setCurrentDirectory(File('C:\Users\fragom\PhD_CIM\Modelica\Models')) 
     filtro = FileNameExtensionFilter("mo files", ["mo"])
     chooseFile.addChoosableFileFilter(filtro)
     ret = chooseFile.showDialog(self, "Choose file")
     if ret == JFileChooser.APPROVE_OPTION:
         self.faile= chooseFile.getSelectedFile()
         if event.getActionCommand() == "Load Model":
             self.cbMoFile.addItem(self.faile.getPath())
             self.cbMoFile.selectedItem= self.faile.getPath()
         if event.getActionCommand() == "Load Library":
             self.cbMoLib.addItem(self.faile.getPath())
             self.cbMoLib.selectedItem= self.faile.getPath()
开发者ID:fran-jo,项目名称:SimuGUI,代码行数:17,代码来源:meegui_jy.py

示例13: loadSimOut

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
    def loadSimOut(self, event):
        chooseFile = JFileChooser()
        filtro = FileNameExtensionFilter("Output files (.h5)", ['h5'])
        chooseFile.addChoosableFileFilter(filtro)
        ret = chooseFile.showDialog(self.frame, "Choose simulation result")
        if ret == JFileChooser.APPROVE_OPTION:
            faile= chooseFile.getSelectedFile()
            self.cbfilesimOut.addItem(faile.getPath())
            self.cbfilesimOut.selectedItem(faile.getPath())

        h5pmu= PhasorMeasH5.PhasorMeasH5(faile)
        h5pmu.open_h5()
        h5pmu.load_h5('pwLine4', 'V')
        # result: 2 vectors per variable, work with pwLine4.n.vr, pwLine4.n.vi
        senyal= h5pmu.get_senyal()
        print senyal
开发者ID:fran-jo,项目名称:SimuGUI,代码行数:18,代码来源:maegui_jy.py

示例14: exportPy

# 需要导入模块: from javax.swing import JFileChooser [as 别名]
# 或者: from javax.swing.JFileChooser import showDialog [as 别名]
 def exportPy(self,event):
     chooseFile = JFileChooser()
     ret = chooseFile.showDialog(self._mainpane, "Choose file")
     filename = chooseFile.getSelectedFile().getCanonicalPath()
     self._stdout.println("Export to : " + filename )
     open(filename, 'w', 0).write( self._pyViewer.getText() )
开发者ID:Logan-lu,项目名称:burp-pyTemplate,代码行数:8,代码来源:generate_python.py


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