some javafx packages cannot be found (like "table") - javafx-2

I tried to start working with Netbeans with java7 and javafx for some GUI project.
Unfortunately, when try to run code I found in the following link (for creating table),
the Netbeans doesn't find some packages (attached!)
I already download the newest Netbean and the newest JavaFX with java 7 from the link below.
Does any one know how can I create those tables?
The download link:
http://www.oracle.com/technetwork/java/javafx/downloads/index.html
I copied the code from:
http://www.adam-bien.com/roller/abien/entry/hello_javafx_2_a_tableview
and the following packages cannot be found:
import javafx.application.Launcher;
import javafx.collections.Sequence;
import javafx.scene.control.table.TableColumn;
import javafx.scene.control.table.TableView;
import javafx.scene.control.table.model.SequenceTableModel;
Thank you,
Aviad

It seems you didn't use JavaFX NB project. Try next: File->New Project->JavaFX/JavaFX Application. Then copy your files to this project.

My solution was to uninstall java, netbeans and then reinstall java, netbeans in that order. Netbeans has issues updating itself. I had the same issue when updating to javafx 2.2.

Related

Migrate Microsoft.WindowsAzure.Mobile.SQLStore to Microsoft.Azure.Mobile.Client.SQLiteStore

I am trying to update one of my Xamarin.Forms apps that uses the deprecated Microsoft.WindowsAzure.Mobile.SQLStore pacakge with the new Microsoft.Azure.Mobile.Client.SQLiteStore package but I get the following error when I try to install the package in my Core pcl project:
Could not install package 'Microsoft.Azure.Mobile.Client.SQLiteStore 4.0.0'.
You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework.
For more information, contact the package author.
I tried to follow this documentation but they seem to forget to add the code sample, so I can't figure out exacly what they are doing. The deprecated Microsoft.WindowsAzure.Mobile.SQLStore package installed in a PCL library but the new Microsoft.Azure.Mobile.Client.SQLiteStore package doesn't or so it seems.
Any help would be appreciated.
It turns out that Microsoft.Azure.Mobile.Client.SQLiteStore 4.0.0 does not support PCL anymore but they moved to .NET Standard 1.4. PCL support stops at version 3.1.0
So if you are using PCL install v3.1.0. But before you install v3.1.0, make sure you manually remove the deprecated Microsoft.WindowsAzure.Mobile.SQLStore first.
Check out this issue for more details: https://github.com/Azure/azure-mobile-apps-net-client/issues/337
you can try and open the .csproj of your PCL and replace the Profile78 entry with a profile the NuGet package supports (probably Profile259 which includes almost everything but windows phone silverlight)
If your project won't compile after changing your profile (because there are missing type references e.g.) try picking a different profile the package supports.
If you're having multiple PCLs you might need to change the target profile of all of them.
Try Changing .Net profile to Profile 7 and then update.
Go To Cross Platforms Project Options->Build->General->.Net Portable

How do i get AndroidStudio to use JDK

In trying to solve a headache (can't import javax.sound.sampled) I came across a post saying that AndroidStudio should be using the JDK, not the JRE. Is this a thing? And if so, how do I get it to use just the JDK?

JavaFX missing from JDK 1.7/1.8 in Linux?

I have a problem that allegedly isn't possible, so I'm having a heck of a time finding an answer.
I have the latest version of NetBeans 7.4, running on fully-updated Fedora 20 x64. Officially, this can work with JavaFX. Period. I have both the JDK from the repo (1.7.something) and the very latest version I could find (1.8.0). Officially, these have JavaFX with them. Period.
If I try to create a new JavaFX project, it has this to say:
Failed to automatically set-up a JavaFX Platform.
Please go to Platform Manager, create a non-default Java SE platform, then go to the JavaFX tab,
enable JavaFX and fill in the paths to valid JavaFX SDK and JavaFX Runtime.
Note: JavaFX SDK can be downloaded from JavaFX website.
Well alright, I'm used to things getting confused, I think I can fix this. Go create a new platform, and... there's no "JavaFX" tab. It took a bit of research to even find out what it was talking about, and in the process I discovered that the tab has actually been removed from 7.4. Because NetBeans 7.4 will absolutely, definitely recognize JavaFX automatically. Period.
Going to the actual JavaFX site tells me, as expected, that it's bundled with the Java SE 7 JDK I already have. Period.
Since the end result I'm after could technically be achieved by integrating one JavaFX component into my Swing application, I attempted that, but NetBeans still can not find anything related to JavaFX and therefore yells at me if I try to import such a thing.
So, given that things that are supposed to just plain work just plain aren't... where can I go from here?
Currently in Debian and Ubuntu (probably others) JavaFX is a separate package from the OpenJDK (openjdk-8-jdk) and so needs to be installed:
sudo apt-get install libopenjfx-java libopenjfx-java-doc
Notable issue (this issue does not impact a Maven, JavaFX application so if that is your preferred build method then ignore the following issue):
If you try to create a new project:
Categories > JavaFX
Project > JavaFXApplication
You'll get:
Internal error. Missing resources [/resources/web-files/javafx-loading-100x100.gif]
/home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:1465: The following error occurred while executing this line:
/home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:3093: The following error occurred while executing this line:
/home/ken/NetBeansProjects/vestFxReports/nbproject/jfx-impl.xml:2055: Error: -includedt requires the java deployment toolkit, which is not included in this distribution
BUILD FAILED (total time: 1 second)
To fix the above error [following steps are derived from here: http://hongouru.blogspot.com.uy/2015/09/solved-error-building-new-project-using.html]:
Switch to the files tab (usually you're on the Project tab).
Expand the node for your project >
expand the nbproject node > open the "project.properties" file.
Find the line javafx.deploy.includeDT=true and change true to false.
Now you can create and run a JavaFX application, on OpenJDK.
Next steps, although beyond the issue at hand you'll probably at some point want to download the JavaFX scene builder: http://www.oracle.com/technetwork/java/javafxscenebuilder-1x-archive-2199384.html
Apparently, the issue is indeed a discrepancy between the open-source OpenJDK provided by most Linux distributions, and the proprietary Oracle JDK. Ironically, this is a well-known issue, but you have to specifically search for it to find it, and by then you already know.
The solution is to download the official Oracle JDK, and if necessary create the matching platform in NetBeans (located under /usr/java/jdk... at this moment). It should work perfectly fine after that.
Perhaps the official documentation
https://netbeans.org/kb/docs/java/nb_fx_screencast.html
https://netbeans.org/kb/72/java/javafx-setup.html
may help you to set it up

javafx.scene.control.Pagination not found

I'm using java 1.7_07 which include javafx 2.2.1.
When I try to import the package javafx.scene.control.Pagination Netbeans doesn't find it. The class is present in the API documentation, I can't see the reason.
Check your javafx version: How to get the version number of JavaFX?
You may use Java Platform in NetBeans settings being setup to older JavaFX and Pagination is a relatively new control.

How to embebed javafx 2.1 in an installation package

I need to distribute a javafx 2.1 application but the client doesn't want to be asked if he wants to install javafx 2.1. It should be automatically installed. Does someone know how to wrap it in a dmg and in an exe package??
Thank you very much in advance.
There is a tutorial here: http://fxexperience.com/2012/03/packaging-javafx-applications-as-native/
and there (although for 2.2): https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_for_javafx
Finally I got it !!!!
I'm going to explain how I got it from my perspective. Sorry if it sounds a little bit dummy but I'm not used to build desktop applications and with a new technology as javafx is even more difficult for me.
Download the latest version of the jdk (in this case the 7.0 one).
Follow the steps from the tutorial and include your .jar and the jfxrt.jar
As a main class I set com.javafx.main.Main
Create the application and now, the most important part:
Once the application has been created, open it (right click on the app and "show package content". Go to the folder: Content/Resources/Java.
Do the same operation with the vm: go to /Java/JavaVirtualMachines and right click on the 1.7.0.jdk to open the Contents folder.
Copy ALL the .jar and .dylib from the jdk to the java resources in your application
Run the application and it will work :)

Resources