From: Debayan Sutradhar Date: Thu, 27 May 2021 19:13:06 +0530 Subject: Added another constructor for HBoxInputBoxWithFileChooser to select custom width --- Added another constructor for HBoxInputBoxWithFileChooser to select custom width --- --- 'a/src/main/java/com/stream_pi/util/uihelper/HBoxInputBoxWithFileChooser.java' +++ b/src/main/java/com/stream_pi/util/uihelper/HBoxInputBoxWithFileChooser.java @@ -27,13 +27,20 @@ import org.kordamp.ikonli.javafx.FontIco import java.io.File; -public class HBoxInputBoxWithFileChooser extends HBox { +public class HBoxInputBoxWithFileChooser extends HBox +{ + public HBoxInputBoxWithFileChooser(String labelText, TextField textField, CheckBox enablerCheckBox, + FileChooser.ExtensionFilter... extensionFilters) + { + this(labelText, textField, enablerCheckBox, 150, extensionFilters); + } - public HBoxInputBoxWithFileChooser(String labelText, TextField textField, CheckBox enablerCheckBox, FileChooser.ExtensionFilter... extensionFilter) + public HBoxInputBoxWithFileChooser(String labelText, TextField textField, CheckBox enablerCheckBox, + int prefWidth, FileChooser.ExtensionFilter... extensionFilter) { textField.setDisable(true); - HBoxInputBox hBoxInputBox = new HBoxInputBox(labelText, textField, 300); + HBoxInputBox hBoxInputBox = new HBoxInputBox(labelText, textField, prefWidth); setHgrow(hBoxInputBox, Priority.ALWAYS); getChildren().addAll(hBoxInputBox); setSpacing(5.0);