1. Annalena Alice
  2. JavaFX
  3. Friday, 20 July 2018
  4.  Subscribe via email
Please help me.......
Comment
There are no comments made yet.
Accepted Answer Pending Moderation
0
Votes
Undo
You can make the Range Slider in javafx by the help of Scene Builder in that you have to select the Range Slider from the Custom Tag and then set the properties according to your requirement

sliderdemo.fxml

<HBox fx:id="menuBar" maxHeight="-Infinity" minHeight="-Infinity" prefHeight="79.0" stylesheets="@styleMain.css" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.propertydrop.SliderDemoController">

Controller class

public class SliderDemoController implements Initializable {
@FXML
private RangeSlider range;
@Override
public void initialize(URL location, ResourceBundle resources) {
ChangeListener<Scene> initializer = new ChangeListener<Scene>() {
@Override
public void changed(ObservableValue<? extends Scene> obs, Scene oldScene, Scene newScene) {
if (newScene != null) {
range.applyCss();
range.getParent().layout();
Pane thumb = (Pane) range.lookup(".range-slider .low-thumb");
System.out.println(thumb); // <-- No longer null
range.sceneProperty().removeListener(this);
}
}
};
range.sceneProperty().addListener(initializer);
}
}


Main

public class SliderDemoMain extends Application {
public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage initStage) throws IOException {
FXMLLoader loader = new FXMLLoader(Drag.class.getClassLoader().getResource("sliderdemo.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root);
Stage primaryStage = new Stage();
primaryStage.setTitle("Slider Demo");
primaryStage.setScene(scene);
primaryStage.show();
}
}

styleMain.css

.range-slider .range-bar {
-fx-background-color: grey;
}

.range-slider .low-thumb {
//....
}
.range-slider .high-thumb {
//....
}
Comment
There are no comments made yet.
  1. more than a month ago
  2. JavaFX
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
经常吃海带。海带中富含大量的碘元素粉嫩公主。这些碘元素对于优化女性身体内部循环和分泌系统具有特殊的功效;它还能够帮助乳房发育粉嫩公主酒酿蛋丰胸产品,减少乳房疾病出现;除此之外,它也能够美容美发丰胸产品,改善你的毛发质量,对于女性同胞来说,海带也是深受她们欢迎的食物丰胸粉嫩公主
Comment
There are no comments made yet.
  1. 3 weeks ago
  2. JavaFX
  3. # 2
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Share Location

Sharing your current location while posting a new question allow viewers to identify the location you are located.

Latitude:
Longitude:
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.