Steven Mark
Steven Mark

Reputation: 265

Using FileChooser in Codename One

I am trying to use FileChooser in cn1. I have followed the instructions here:

Codename One

and

GitHub

I added the extension and then refreshed my cn1libs

Once this was done I added the code sample to my code but it underlines the word FileChooser in red and gives me the error that it cannot find symbol. When I hover over the line it asks if I want to create a field called FileChooser

Normally when I add a new lib it will automatically import it - but I do not see an import statement at the top of my code. Perhaps I need the import? If so please can someone give me the path as I do not know whereabouts the actual lib resides? Any advice is appreciated

Thanks

Upvotes: 3

Views: 408

Answers (1)

Diamond
Diamond

Reputation: 7483

Check in your project lib folder to ensure the CNFileChooser.cn1lib exists. If it does exist, clean and build your project to see if this will fix the import.

You could also try Ctrl+Shift+i to fix import on Windows Netbeans or Cmd+Shift+i on Mac Netbeans.

Before you do Refresh cn1lib files, make sure your code is error-free (i.e no red underline). Comment out erroneous codes and uncomment them after the refresh.

Be sure to import com.codename1.ext.filechooser.FileChooser and not javafx.stage.FileChooser.

If the problem persists, kindly share your operating system and IDE details here to get further assistance.

Upvotes: 3

Related Questions