Package javax.swing

Examples of javax.swing.JFileChooser


   */
  protected void performSelectFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter(XSSFExcelExportDialog.XLS_FILE_EXTENSION,
          getResources().getString("excelexportdialog.excel-file-description")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
    }
View Full Code Here


                          final String title,
                          final FilesystemFilter[] rawFilter)
  {
    final FilterKey key = new FilterKey(rawFilter);

    final JFileChooser fileChooser = new JFileChooser();
    final FilesystemFilter[] filters = key.getFilters();
    for (int i = 0; i < filters.length; i++)
    {
      final FilesystemFilter filesystemFilter = filters[i];
      fileChooser.addChoosableFileFilter(filesystemFilter);
    }
    final File o = (File) instances.get(key);
    if (o != null)
    {
      final File parentDir = o.getParentFile();
      if (parentDir != null)
      {
        fileChooser.setCurrentDirectory(parentDir);
      }
    }
    final int result = fileChooser.showSaveDialog(parent);
    if (result == JFileChooser.APPROVE_OPTION)
    {
      final File resultFile = fileChooser.getSelectedFile();
      instances.put(key, resultFile);
      return resultFile;
    }

    return null;
View Full Code Here

   */
  protected void performSelectFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter
          (CSVDataExportDialog.CSV_FILE_EXTENSION, getResources().getString(
              "csvexportdialog.csv-file-description")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
View Full Code Here

  {
    final File file = new File(getFilename());

    if (fileChooserHtml == null)
    {
      fileChooserHtml = new JFileChooser();
      fileChooserHtml.addChoosableFileFilter
          (new FilesystemFilter(
              new String[]{HtmlStreamExportDialog.HTML_FILE_EXTENSION, HtmlStreamExportDialog.HTM_FILE_EXTENSION},
              getResources().getString("htmlexportdialog.html-documents"), true)); //$NON-NLS-1$
      fileChooserHtml.setMultiSelectionEnabled(false);
View Full Code Here

   */
  protected void performSelectFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter
          (CSVTableExportDialog.CSV_FILE_EXTENSION, getResources().getString(
              "csvexportdialog.csv-file-description")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
View Full Code Here

  public File performOpen(final Component parent,
                          final String title,
                          final FilesystemFilter[] rawFilter)
  {
    final FilterKey key = new FilterKey(rawFilter);
    final JFileChooser fileChooser = new JFileChooser();
    final FilesystemFilter[] filters = key.getFilters();
    for (int i = 0; i < filters.length; i++)
    {
      final FilesystemFilter filesystemFilter = filters[i];
      fileChooser.addChoosableFileFilter(filesystemFilter);
    }
    final File o = (File) instances.get(key);
    if (o != null)
    {
      final File parentDir = o.getParentFile();
      if (parentDir != null)
      {
        fileChooser.setCurrentDirectory(parentDir);
      }
    }
    final int result = fileChooser.showOpenDialog(parent);
    if (result == JFileChooser.APPROVE_OPTION)
    {
      final File resultFile = fileChooser.getSelectedFile();
      instances.put(key, resultFile);
      return resultFile;
    }

    return null;
View Full Code Here

  protected void performSelectFile()
  {
    // lazy initialize ... the file chooser is one of the hot spots here ...
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      final FilesystemFilter filter = new FilesystemFilter(PdfExportDialog.PDF_FILE_EXTENSION,
          getResources().getString("file.save.pdfdescription")); //$NON-NLS-1$
      fileChooser.addChoosableFileFilter(filter);
      fileChooser.setMultiSelectionEnabled(false);
    }
View Full Code Here

  {
    tableModel = new PaintComponentTableModel();
//    tableModel.addComponent(new JButton ("A button"));
//    tableModel.addComponent(new JLabel ("A Label"));
//    tableModel.addComponent(new JCheckBox ("A CheckBox"));
    tableModel.addComponent(new JFileChooser());
    tableModel.addComponent(new JColorChooser());
  }
View Full Code Here

   */
  protected void performLoadFile()
  {
    if (fileChooser == null)
    {
      fileChooser = new JFileChooser();
      fileChooser.addChoosableFileFilter(new FilesystemFilter
          (CSV_FILE_EXTENSION, resources.getString("csvdemodialog.csv-file-description")));
      fileChooser.setMultiSelectionEnabled(false);
    }

View Full Code Here

    public void run()
    {
      tableModel.addComponent(new JButton("A button"));
      tableModel.addComponent(new JLabel("A Label"));
      tableModel.addComponent(new JCheckBox("A CheckBox"));
      tableModel.addComponent(new JFileChooser());
      tableModel.addComponent(new JColorChooser());
    }
View Full Code Here

TOP

Related Classes of javax.swing.JFileChooser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.