javafx-8

How to convert css into bss

折月煮酒 提交于 2019-11-29 12:26:33
I found this post http://docs.oracle.com/javafx/2/deployment/packaging.htm#BABCACBD Can you tell me how I can use this tool to convert css files into bss files? From the information on the web site it's not very clear how I can use it for JavaFX application. Any help will be highly appreciated. Let's imagine your jdk 8 home bin directory is on your shell path. Create Love.java : import javafx.stage.*; import javafx.application.*; import javafx.scene.control.*; import javafx.scene.*; public class Love extends Application { public void start(Stage stage) throws Exception { Scene scene = new

Javafx Internationalization with custom language

情到浓时终转凉″ 提交于 2019-11-29 11:46:35
I'm developing a JavaFX application with multiple language support. My app sometimes shows an alert box, for example: package application; import java.util.Locale; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Button; import javafx.scene.control.Alert.AlertType; import javafx.scene.layout.BorderPane; public class Main extends Application { @Override public void start(Stage primaryStage) { try { Button btn = new Button("Show alert"); btn.setOnAction(this

Running swing application in javaFX

こ雲淡風輕ζ 提交于 2019-11-29 11:33:26
I have a code that work perfectly on Swing but I want to integrate it on javaFX. I know that I must use SwingNode but the code dosen't work in javaFX. this is .jar of librarie I use : http://forge.scilab.org/index.php/p/jlatexmath/downloads/694/ this is the result in swing : this is the code in Swing : import org.scilab.forge.jlatexmath.TeXConstants; import org.scilab.forge.jlatexmath.TeXFormula; import org.scilab.forge.jlatexmath.TeXIcon; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage;

Wait before Reacting to a Property Change JavaFX 8

江枫思渺然 提交于 2019-11-29 11:30:38
Is there a way to keep listening to a property change, for a few seconds, then fire an event (call a method)? For example, when the user enter data in a text field: textField.textProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> arg0, String arg1, String arg2) { //before calling a method to do something.. wait for a few seconds ... } }); A scenario would be firing an action based on the string value. For example, hitting "M" for move, or "MA" for mask. I would like to "keep listening" for 2 seconds before making an action.

JavaFX: How to disable a row in a TableView?

别说谁变了你拦得住时间么 提交于 2019-11-29 10:51:40
I want to disable a row in a TableView. I have a Tableview of Products, and I already know which product needs to be disabled (I got the index of it from the ObservableList that fills the TableView). How do I get the TableRow that is associated with Product in the ObservableList, of which I know the index? Otherwise: is there a easy way to disable a specific TableRow from a TableView? Any help is greatly appreciated. The best way is not to use the index, but to use a custom row factory and observe the appropriate properties of the item in the row. This is slightly tricky with the current API,

How to wrap a swing component in a javaFX 2.0 application

蓝咒 提交于 2019-11-29 09:51:57
The ability to wrap a swing component in a javaFX application seems to have vanished from javaFX 2: javafx.ext.swing.SwingComponent is not there any more in javaFX 2 beta API. Is there still a way to do this in the new API? SwingNode class is used to embed a Swing content into a JavaFX application. Here is the link . There is 3rd-party support library, see http://rkennke.wordpress.com/2011/11/16/swing-in-javafx-demo/ According to this issue on the FX 2.0 JIRA they aren't planning to support it in the initial release of FX 2.0. There's also no promise that they will do it down the road. http:/

JavaFX 8 Transform to pitch, yaw and roll rotation angles

隐身守侯 提交于 2019-11-29 09:01:23
Implementing the answer from this thread I have this code that translates the deltayaw, deltaroll and deltapitch angles into one angle and rotates a node around it. The angles that are taken as the parameters are momentary changes of angles since giving the whole angles would ignore the changes in orientation. public static void matrixRotate(Group n, double deltaroll, double deltapitch, double deltayaw){ double A11 = Math.cos(deltaroll)*Math.cos(deltayaw); double A12 = Math.cos(deltapitch)*Math.sin(deltaroll)+Math.cos(deltaroll)*Math.sin(deltapitch)*Math.sin(deltayaw); double A13 = Math.sin

How to access parent member controller from child controller

别等时光非礼了梦想. 提交于 2019-11-29 07:52:56
This question is similar to this , but I need to access parent member (not control). I don't know if is possible to do without using Dependency Injection. For example, I have a Parent with have a member calls User, I need to access from child controller to User. Just pass the reference from the parent controller to the child controller in the parent controller's initialize() method: ParentController.java: public class ParentController { @FXML private ChildController childController ; private User user ; public void initialize() { user = ...; childController.setUser(user); } } ChildController

JAVAFx Build Failed

拥有回忆 提交于 2019-11-29 07:37:44
I created an app with JavaFx for windows, which is really cool. I can run it from e(fx)clipse, everthing works fine, but I can't make a jar file from the project. I can export it (Right click->Export->Runnable Jar File). However, if I run the jar on MAC OS X , in the menu bar I get "java" menuitem instead of my application name ,which i really don't like. I searched for how to hide that menuitem, or just rename it, and I found that I have to rename the "Application title*" in the build.fxbuild file. Now I can't build it. So this is what I really want: to remove/hide/rename the "java" menuitem

Centering an image in an ImageView

那年仲夏 提交于 2019-11-29 07:33:58
I am currently trying to center an image in an ImageView using JavaFX. So I load the image in the view : Image img = new Image("..."); imageView.setImage(img); and let's suppose the image is huge (2000x3000) and not the ImageView (400x100) The rendered image will be aligned on the left, and I would like to put in the center of the ImageView : Is there anyway to perform that ? So, after days of calculation, I managed to find a good way to do it. I post it here in case of someone would like to achieve it. I created a method that only needs access to the imageView : public void centerImage() {