Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Some while ago I reported intermittent problems when using an adaption of the jFileChooser method on Mac platform. As soon as the file choice dialog box appears on screen clicking anwhere on it causes a spinning beachball of death and Filemaker has to be crashed, which as we all know is one sure fire way to damage a file.

I wonder if you have made any progress on finding why?

FM 11.0.3 and the latest SM plugin OSX 10.6.7


// ChooseFiltered(fm_Path, fm_Message, fm_FileType, fm_Button, fm_Select)

// 11_06_02_JR WORKING

// v1.2

// fm_Path startpath for dialog

// fm_Message for dialog title

// fm_Button sets text for default 'accept' button

// fm_FileType selects file filter - p > pdf, i > images, f > fonts

// ... d > documents, x > data files, z > archives, a > all filters, null > no filters

// fm_Select is flag to set what is selected - f > files, d > dirs, null > both



if (System.getProperty("java.version").substring(0, 2) == "1." && System.getProperty("java.version").substring(2, 3).toInteger() < 6 ){

	return 'ERROR'

}



import javax.swing.JFileChooser

import javax.swing.filechooser.FileNameExtensionFilter



chooser = new JFileChooser()

if (fm_Select == "d"){

	chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY )

} 

if (fm_Select == "f"){

	chooser.setFileSelectionMode( JFileChooser.FILES_ONLY )

} else chooser.setFileSelectionMode( JFileChooser.FILES_AND_DIRECTORIES )

if( fm_Path != null ) chooser.setCurrentDirectory( new File(fm_Path) )

if( fm_Message != null ) chooser.setDialogTitle( fm_Message )

//chooser.setFileHidingEnabled(false)

// sets whether or not hidden files are shown

pdf = new FileNameExtensionFilter( "PDF files", "pdf" )

img = new FileNameExtensionFilter( "Image files", "jpg", "gif", "jpeg", "png", "tif", "bmp" )

doc = new FileNameExtensionFilter( "Documents", "doc", "docx", "txt", "wri", "htm", "html", "css", "log" )

xml = new FileNameExtensionFilter( "Data files", "csv", "xls", "xlsx", "xml", "tab", "xsl" )

zip = new FileNameExtensionFilter( "Archives", "zip", "dmg", "jar", "rar" )

fnt = new FileNameExtensionFilter( "Fonts", "ttf", "otf" )

if ( fm_FileType == "i"){

	chooser.setFileFilter(img)

	}

else if ( fm_FileType == "d"){

	chooser.setFileFilter(doc)

	}

else if ( fm_FileType == "p"){

	chooser.setFileFilter(pdf)

	}

else if ( fm_FileType == "x"){

	chooser.setFileFilter(xml)

	}

else if ( fm_FileType == "z"){

	chooser.setFileFilter(zip)

	}

else if ( fm_FileType == "f"){

	chooser.setFileFilter(fnt)

	}

else if ( fm_FileType == "a"){

	chooser.addChoosableFileFilter(img)

	chooser.addChoosableFileFilter(doc)

	chooser.addChoosableFileFilter(pdf)

	chooser.addChoosableFileFilter(xml)

	chooser.addChoosableFileFilter(zip)

	chooser.addChoosableFileFilter(fnt)

	chooser.setAcceptAllFileFilterUsed(true)

	}

else if ( fm_FileType == null){

	chooser.setAcceptAllFileFilterUsed(true)

}

chooser.setApproveButtonText(fm_Button)

chooser.setApproveButtonToolTipText("Import this file")

//chooser.setAcceptAllFileFilterUsed(false)

if( chooser.showOpenDialog( null ) == JFileChooser.APPROVE_OPTION ) {

	// select depending on format you require to be returned

	//return chooser.getSelectedFile().getCanonicalPath()

	return chooser.getSelectedFile().getAbsolutePath()

} else return false

  • 8 months later...

I too get the 'beach ball of death' but (and this is the good news) I can select a file or click 'cancel' as if I had a regular mouse pointer. It is just 'weird'.... Ron Feb 2012

Make sure that you have the function in question checked as a GUI function.

I think I 'got it'.

If I set Allow User Abort [On] everything works as expected.

If I set Allow User Abort [Off] I get the spinning ball. (Unless I answer the preceeding dialog with an OK within 2 seconds)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.