javafx-8

How do i show a context menu when right click on a Pane or an ImageView in javaFX

随声附和 提交于 2019-12-21 06:37:06
问题 I am trying to show a context menu i created, when i right click on a pane or an image view ((on Context Menu Requested)). The problem is they don't seem to have a setContextMenue method, unlike labels and buttons...etc. How can associate a context menu to a node that doesn't seem to accept context menus? @FXML Button button1, button2; @FXML Pane mainPane; @FXML ImageView image; private void initContextMenu() { final ContextMenu contextMenu = new ContextMenu(); final MenuItem item1 = new

How to click a button on website loaded into JavaFX Webengine

﹥>﹥吖頭↗ 提交于 2019-12-21 05:31:21
问题 I am pretty new to JavaFX. I have successfully loaded a website into my JavaFX application. I would like to log in to the website from my java application. So far I am able to insert my login values to the appropriate input box, but I cannot figure out how to click submit button. Can Someone help me. Here is what I have so far. Here is my controller class. public class Controller implements Initializable{ @FXML protected TextField usernameLogin; @FXML protected TextField passwordLogin; @FXML

How to click a button on website loaded into JavaFX Webengine

本秂侑毒 提交于 2019-12-21 05:31:07
问题 I am pretty new to JavaFX. I have successfully loaded a website into my JavaFX application. I would like to log in to the website from my java application. So far I am able to insert my login values to the appropriate input box, but I cannot figure out how to click submit button. Can Someone help me. Here is what I have so far. Here is my controller class. public class Controller implements Initializable{ @FXML protected TextField usernameLogin; @FXML protected TextField passwordLogin; @FXML

JavaFX TableView Edit with single click and auto insert row?

若如初见. 提交于 2019-12-21 04:38:16
问题 I used tableview in my program to display few rows it was good . my program is used for accounting and as you know there is alot of data insertion in it and i used the table view and i faced a lot of problem :. problem 1 : when the user want to modify a value he will double click to get edit the cell i want my user to select any row and start typing . problem 2 : in my program the user may insert 100 row for a day of work i need a strategy to adding row automatically for example when he

How to add a tooltip to a TableView header cell in JavaFX 8

时光毁灭记忆、已成空白 提交于 2019-12-21 03:57:19
问题 Does anyone know how to add a tooltip to a column header in a TableView ? There are many places where are explained how to add the tooltip to data cells, but I didn't find a way to add the tooltip to header. Using the tool ScenicView, I can see that the headers are Labels inside a TableColumnHeader object, but It seems that It is not a public object. Any suggestions ? 回答1: TableColumn<Person, String> firstNameCol = new TableColumn<>(); Label firstNameLabel = new Label("First Name");

How to analyze incoming message (JavaFX on Android)

。_饼干妹妹 提交于 2019-12-21 02:59:29
问题 I ported my JavaFX application to my Android device. I want my application to read incoming SMS messages and store it in a database. I found several questions here in StackOverflow but I don't know how to implement in a JavaFX approach. Please help! 回答1: These are the required steps to create and port a JavaFX application to an Android device, so you can track SMS messages, allowing: sending SMS to the number you type. Warning: This may by subjected to costs to your mobile account. reading

FXML, JavaFX 8, TableView: Make a delete button in each row and delete the row accordingly

半世苍凉 提交于 2019-12-20 23:23:14
问题 I am working on a TableView (FXML) where I want to have all the rows accompanied with a delete button at the last column. Here's a video that shows what I mean: YouTube Delete Button in TableView Here's what I have in my main controller class: public Button del() { Button del = new Button(); del.setText("X"); del.setPrefWidth(30); del.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { int i = index.get(); if(i > -1) { goals.remove(i); list.getSelectionModel(

Heavy rendering task (in canvas) in JavaFX blocks GUI

怎甘沉沦 提交于 2019-12-20 20:18:12
问题 I want to create an application that performs many renderings in a canvas. The normal JavaFX way blocks the GUI: It is realy hard to press the button in the application code below (run with Java 8). I searched the web, but JavaFX does not support background rendering: All rendering operation (like strokeLine) are stored in a buffer and are executed in the JavaFX application thread later. So I cannot even use two canvases and exchange then after rendering. Also the javafx.scene.Node.snapshot

Issue with background color in JavaFX 8

蓝咒 提交于 2019-12-20 17:38:36
问题 Looks like there is an issue with setting background colors for panels in JavaFX 8. I had been trying the below, but none of them set the appropriate background colors. VBox panel = new VBox(); panel.setAlignment(Pos.TOP_LEFT); // None of the below work panel.setStyle("-fx-background-color: #FFFFFF;"); panel.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); Is there something wrong in the way I am setting the background color? This used to work

How to handle java web start (jnlp) downloading progress in a preloader?

隐身守侯 提交于 2019-12-20 11:06:49
问题 Issue I have a preloader for my application that handles the Application-specific initialization. Now I'm trying to extend this so that the preloader also shows the progress of the downloaded application JARs. TL;DR Why is the preloader not getting loaded during Phase 2 , as this should handle the PreloaderFx::handleProgressNotification(); to track the downloading of the JARs I suppose? Update 14 March 2016 : Is using DownloadServiceListener the way to solve this? How to connect this to a