All Questions
Tagged with eventhandler javafx
91
questions
-2
votes
1
answer
129
views
JavaFX: Help setting event listeners to set variables and print text? [closed]
I am writing a program that is a "sandwich ordering app". Think subway. Bread choice, meat choice, cheese choice, etc. I'm trying to use each type of element (radio buttons, combobox, slider,...
0
votes
0
answers
24
views
How to access a non-FXML attribute inside an EventHandler?
Suppose we have the following constructor of a simple JavaFX project:
public class FXMLController{
private Model model;
@FXML private Button button;
public void ...
0
votes
0
answers
21
views
Having issuse diagnosing Null Pointer Exception in FXML controller.(Homework) [duplicate]
I am new to JavaFX and FXML, I have my main Stage constructed, I am able to get the text in the Text box to change, but anytime I attempt to confirm submission in the TextField I get a Null Pointer ...
0
votes
0
answers
109
views
JavaFX: Linking variables correctly for EventHandler (Timeline)
I need to set up a simulation of a nuclear power plant in JavaFX. The GUI is working perfectly, but I've got problems with getting the simulation run. I have to use a Timeline (as EventHandler) for ...
0
votes
1
answer
73
views
Application will not display when JavaFX code is ran
I'm working on a very small, brief application to calculate charges for an upcoming conference. The app displayed fine when I ran the code until I added my event handler. Everything seems to be in ...
0
votes
1
answer
102
views
JavaFX: execute events in Sub- and in SuperClass
if I implement an onMouseClicked-EventHandler in a SuperClass like this:
public class SuperClass {
public SuperClass() {
setOnMouseClicked(new EventHandler<Event>() {...
3
votes
1
answer
663
views
Javafx one eventhandler to catch them all?
I am playing around with javafx and am trying to add an EventHandler or EventFilter (not totally sure what the difference is right now) to one of my scenes. It should just detect any input, from mouse ...
0
votes
1
answer
2k
views
How to display an image when a button is pressed in JavaFX
I'm having trouble figuring out how to display an image when a button is pressed. Here's what I have so far:
public class Flags extends Application {
@Override
public void start(Stage primaryStage) {...
0
votes
1
answer
899
views
About PauseTransition in javafx
I created a VBox (root) and added some Button in it. When I click the button with text "Click" (button_to_click), ten other button (an button array with ten elements) will change background color into ...
0
votes
0
answers
832
views
Why javafx application is crashing while using EventHandler and java.net socket at the same time?
I'm trying to build some Chatting Application with Javafx and java.net networking package. I want the text the User typed in the textfield to be send from the client to the server and from there back ...
0
votes
2
answers
166
views
How to pass TextField info to handle() method
Beginner question: The last part of my assignment is to change the handle() method so when the button is clicked, it returns the result for a miles per gallon calculator. How do I get the user input ...
0
votes
2
answers
88
views
Is there any way to create more clarity in my JavaFX code? [closed]
I'm in the first year of my computer science study, and I just got my first project in which I have to create an application that can perform CRUD operations on an SQL database. This application needs ...
0
votes
1
answer
171
views
How to get Key Press working on two file Javafx project
I've a "driver" file and a source file for the project I'm working on right now. In my driver file I add an EventHandle to me stage.
stage.addEventHandler(KeyEvent.KEY_TYPED, shape.getKeyHandler());
...
0
votes
1
answer
476
views
JavaFX remove eventhandler from lambda expression [duplicate]
I'm trying to add an event handler to a canvas which removes itself when a condition is fulfilled.
I tried doing this, but I'm getting an error which says the variable may have not been initialized.
...
0
votes
1
answer
474
views
How to register a buttonhandler (nested class)
I am trying to register my button, but I don't know how to do that, I have created a nested class ButtonHandler implementing EventHandler to define its action.
I've tried the code musicRecord....