All Questions
39 questions
-1
votes
2
answers
91
views
JavaFX - transform from disable to enable button
Controller of the father class
this class contains 3 button 'btnSocieta', 'btnUnitaLocali', 'btnReparti'.
The first is enable from default other 2 are disable.
In the stackPane i show the start page ...
0
votes
0
answers
52
views
How to disable a button for input validation in FXML
I have two fields: username and password. I want a button to remain disabled if these fields are blank or their length is less and n characters.
I tried using button disableProperty() in my controller ...
0
votes
0
answers
134
views
How to create a button which if it's clicked, it expands and shows details?
I have this table, where there are several entries with an orderID.
To show more informations about the entry, you can click on the but
Is this think doable with javafx Scene Builder? What should I ...
0
votes
1
answer
11
views
CLICK JAVAFXML BUTTON SCENEBUILDER
@FXML
void handleButtonAction(ActionEvent event) {
buttonOpenFile.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
...
0
votes
0
answers
161
views
check which button got clicked javafx
can anyone help, I'm making a program to buy credit. Does anyone know how to confirm the nominal number button has been clicked before the transaction button?
My program has an error when I haven't ...
0
votes
1
answer
45
views
JavaFX call function on random created buttons
So, I am working on this school project where I created multiple buttons with text loaded from my database. These buttons are created everytime by listing a new button with another piece of text ...
-2
votes
1
answer
52
views
How can i do to disable button itself? [closed]
I have a Button and i like it sets disable itself with b_generer.setDisable(true); , how can i do it ?
when i try to do this in
@FXML private Button b_generer;
...
public void initialize(){
...
...
0
votes
2
answers
1k
views
Implementing numerous buttons using an arrayList in javaFX
I am implementing a User Interface for a restaurant menu that involves a large number of increment and decrement buttons as shown below - please note I have used SceneBuilder to create the UI:
I have ...
0
votes
1
answer
2k
views
In javafx how do i change the color of a button, wait 1 second than change it back do default?
So i want to change the color of a button to light green, wait 1 second than change it back to default.
How can i do this? I tried it this way:
button1.setStyle("-fx-background-color: lightgreen");
...
0
votes
1
answer
1k
views
Button returning null pointer in fxml
I have a problem with a button when trying to work with JavaFX. I am trying to set a custom font to a button. The moment I try to change the font of the button, the program crashes.
The other topics ...
-2
votes
1
answer
51
views
how can I do something while the program is waiting to press the button? [closed]
i want to change the cirecle color all the time the COUNTER is smaller than 3 and while i waiting to click button.
When the the cirecle is red he need to push on 'Stop'.
This is the program:
public ...
-1
votes
2
answers
181
views
How to find the end point of a paragraph (Label) in JavaFX?
Simple question, hopefully there is a simple solution. I have a Label in my JavaFX application in which I would like a button to be at the end of a paragraph. By the end of the paragraph, I mean as ...
3
votes
1
answer
2k
views
Java FX buttons slightly smaller when clicked/focus
I have an issue where my buttons in JavaFX become slightly smaller when clicked.
here you can see that the "change password" button is clicked/selected.
here you can see the "admin functions" ...
-1
votes
1
answer
2k
views
Accessing button made in FXML (using scene builder) in Controller class [duplicate]
This is part of my fxml code
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene....
0
votes
1
answer
3k
views
Javafx and fxml button not clickable
I have a mixed up codes where I am building a program using Scene Builder with Splash Screen. I built a button on a TitledPane on top of Anchor Pane which is root. I set the fx:id and when I run, I ...
0
votes
1
answer
5k
views
(JavaFX)(Scene Builder) How can I make a button appear after a button is clicked?
So for some context, all I want to to do is have two buttons appear after a different button is clicked, and then those two buttons would do something when they are clicked. Any ideas?
Controller ...
0
votes
2
answers
2k
views
(JavaFX) How can I change a picture in an ImageView thats coded in an fxml file with a basic java class?
I am currently making a program, I want to have a button get clicked and it runs another class and depending on the output of that class, I want an image view on the same scene as the button that was ...
1
vote
1
answer
906
views
(JavaFX FXML) While trying to make a custom button, how do I get an image to completely fill a button?
(JavaFX FXML) I'm currently using scene builder to make an app and I'm trying to make a custom button, I managed to get an image onto the button but I can't figure out how to get the image to ...
0
votes
1
answer
381
views
Can't execute button style methods (FXML button) from controller class. How can I setstyles of a FXML button and not using CSS for this?
I can't set the style of a button simply within an if-then-statement or a method.
It compiles well but gives an error when running the application. The idea is to color a button when the parameter "...
1
vote
1
answer
469
views
Graphic automatically fill button
I'm using JavaFX, fxml, and css to display buttons with an image. When I change the size of the window, the image of the button nicely moves with the center of the button. I also want the image to ...
2
votes
2
answers
53
views
My button can't open my class
Basically, the problem is I created an interface with Java Scene Builder. And from FXML button I wanted to open my class.
@FXML
public void pressButton(ActionEvent event) throws Exception {
...
0
votes
0
answers
79
views
(fxml) Activate Button when user starts typing on TextField
I have a TextField in my FXML and a Button to "save" whatever is in the TextField. I'd like to have the Button disabled up until the user starts typing in the TextField, in which the Button becomes ...
5
votes
1
answer
19k
views
Javafx button sending arguments to ActionEvent function
I'm learning how to use javafx, along with scenebuilder by creating a very basic calculator but I've come across a problem where it's hard for me to find a way to not have a seperate function for each ...
7
votes
4
answers
32k
views
JavaFX Button with transparent background
I have some classical Button in JavaFX with a box containing some text.
I need buttons without that box, just the text, and when I hover the button or click on the button with mouse, it shall change ...
0
votes
2
answers
189
views
Multiple FXML variables to 1 controller handle
How can I make a handle that applies to each of the buttons, so I don't have to make a near-identical handle for each button?
So I have a FXML file with 9 contacts, each looks like this:
<Button ...
1
vote
2
answers
3k
views
Determine clicked button in javafx
I have a piece of code that response to click on buttons in desktop application. I have two buttons that do the same thing: they copy to clipboard information from the text field to the left. I have ...
13
votes
1
answer
26k
views
JavaFX CSS Button with Image - How to define the size of the image?
I am trying to insert an image in a button using JavaFX CSS. Although, I can do it easily using the "-fx-graphic" tag, I cannot find a way to resize the image in whatever size I want.
I can do this ...
0
votes
2
answers
5k
views
How to make buttons retain their size in FXML
So the Button look normal when the program starts but If the decrease the size the window with my cursor horizontally or vertically, the buttons shrink to a smaller size.
Code
FXML File
<?import ...
1
vote
2
answers
228
views
Image doesn't properly cover the button
I am unable to properly adjust the size of the image so that both the image and the button fit one another.
Here is the important part of the code:
<Button prefHeight="80" prefWidth="80" id="...
4
votes
1
answer
377
views
How to center scaled vector graphic on Button?
I want to draw scaled SVGPath nodes centered on button. Button should maintain its size independent of image size, and SVGPaths should retain their relative positions.
I am new to JavaFX so maybe I'm ...
1
vote
1
answer
4k
views
Table with buttons using FXML (JavaFX)
I am learning JavaFX and FXML. I am using the tutorials available on the Oracle website.
In particular, I am developing an application using the Oracle example of an FXML Address Book as a starting ...
0
votes
1
answer
1k
views
How to Get Button Position defined in FXML File from java class
I created with javafx scene builder the fxml file for the interface.
Now I need to get the button position on the interface but when I call the button method to get the X,Y coord, the value returned ...
-1
votes
1
answer
8k
views
In Java FX, how do you set the text programmatically? [duplicate]
Okay, so I want to change the text in a button using JavaFX but I can't figure out how :/ this is my code:
package application;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
...
-1
votes
2
answers
4k
views
How to set button text in JavaFX?
I'm trying to set the button text using this code:
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
//checking to see whether these buttons ...
0
votes
1
answer
3k
views
FXML Button activate on enter
I need to us a .fxml file to build my GUI. I need actually need to make it work without a mouse, just keyboard action....
So, here is the button in fxml:
<HBox spacing="10" alignment="bottom_right"...
1
vote
1
answer
1k
views
Full screen under JavaFX with FXML does not work
Please have a look at the code snippets:
import java.io. *;
* import java.sql.;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.image.Image;
import java.io....
0
votes
2
answers
3k
views
Styleclass not being applied when the previous style class is added in FXML
I assign styleclass of ToggleButton in FXML file as follows:
<ToggleButton fx:id="Button" styleClass="defaultStyle">
Later, in my code I change the style classes as follows:
@FXML private ...
4
votes
2
answers
6k
views
How to remove the expand effect on button clicked JavaFX?
How can I remove the small expand effect when I click on a JavaFX button? And also how can I make it work like an menu button (when I press it to remain in focused state untill I press another "menu" ...
19
votes
2
answers
94k
views
How to position a button (or any GUI element) in a JavaFX scene?
I am trying to put a JavaFX button in a specific place (specific coordinates) on a UI, but nothing is working. I'm guessing that there is a method that is used for this, but I can't find it.