javafx.scene.control.Label.widthProperty()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中javafx.scene.control.Label.widthProperty()方法的一些代码示例,展示了Label.widthProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.widthProperty()方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:widthProperty

Label.widthProperty介绍

暂无

代码示例

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public CoinPriceAlwaysVisible() {
  amount = new SimpleStringProperty(this, "amount", "");
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public BaleAmountAlwaysVisible() {
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  amount = new SimpleStringProperty(this, "amount", "");
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public BarrelAmountAlwaysVisible() {
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  amount = new SimpleStringProperty(this, "amount", "");
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public FightingSkillAlwaysVisible() {
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  amount = new SimpleStringProperty(this, "amount", "");
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public NavigationSkillAlwaysVisible() {
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  amount = new SimpleStringProperty(this, "amount", "");
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

public TradingSkillAlwaysVisible() {
  getStylesheets().add(this.getClass().getResource("icons.css").toExternalForm());
  amount = new SimpleStringProperty(this, "amount", "");
  final ImageView imageView = new ImageView(img);
  final Label text = new Label();
  text.getStyleClass().add("iconText");
  text.textProperty().bind(amount);
  imageView.layoutXProperty().bind(text.widthProperty().add(3));
  getChildren().addAll(text, imageView);
}
public void setAmount(Integer amount) {

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

this.icon.layoutXProperty().bind(this.icon.widthProperty().divide(-2));
  this.icon.layoutYProperty().bind(this.icon.heightProperty().divide(-2));
} else if( location == Location.TOP_RIGHT ) {
  this.icon.layoutXProperty().bind(Bindings.createDoubleBinding(() -> {
    return Double.valueOf(c.getWidth() - this.icon.widthProperty().get() / 2);
  },this.icon.widthProperty(), c.widthProperty()));
  this.icon.layoutYProperty().bind(this.icon.heightProperty().divide(-2));
} else if( location == Location.BOTTOM_LEFT ) {
  this.icon.layoutXProperty().bind(this.icon.widthProperty().divide(-2));
  this.icon.layoutYProperty().bind(Bindings.createDoubleBinding(() -> {
    return Double.valueOf(c.getHeight() - this.icon.heightProperty().get() / 2);
} else if( location == Location.BOTTOM_RIGHT ) {
  this.icon.layoutXProperty().bind(Bindings.createDoubleBinding(() -> {
    return Double.valueOf(c.getWidth() - this.icon.widthProperty().get() / 2);
  },this.icon.widthProperty(), c.widthProperty()));
  this.icon.layoutYProperty().bind(Bindings.createDoubleBinding(() -> {
    return Double.valueOf(c.getHeight() - this.icon.heightProperty().get() / 2);

代码示例来源:origin: stackoverflow.com

message.textProperty().bind(textArea.textProperty());
message.widthProperty().addListener((observable, oldValue, newValue) -> {
  bubble.setWidth(newValue.intValue() + 10);
  Platform.runLater(new Runnable() {

代码示例来源:origin: com.github.almasb/fxgl-base

barGroup.setTranslateX(0);
  barGroup.setTranslateY(0);
  label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
  label.translateYProperty().bind(height);
  break;
case LEFT:
  barGroup.translateXProperty().bind(label.widthProperty().add(10));
  barGroup.setTranslateY(0);
  label.setTranslateX(0);
  barGroup.setTranslateX(0);
  barGroup.translateYProperty().bind(label.heightProperty());
  label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
  label.setTranslateY(0);
  break;

代码示例来源:origin: com.github.almasb/fxgl-ui

barGroup.setTranslateX(0);
  barGroup.setTranslateY(0);
  label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
  label.translateYProperty().bind(height);
  break;
case LEFT:
  barGroup.translateXProperty().bind(label.widthProperty().add(10));
  barGroup.setTranslateY(0);
  label.setTranslateX(0);
  barGroup.setTranslateX(0);
  barGroup.translateYProperty().bind(label.heightProperty());
  label.translateXProperty().bind(width.divide(2).subtract(label.widthProperty().divide(2)));
  label.setTranslateY(0);
  break;

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

final ImageView imageView = new ImageView(compassIcon);
  imageView.setId("captainIcon");
  imageView.layoutXProperty().bind(sailorsOnShip2.widthProperty().add(3));
  g.getChildren().addAll(sailorsOnShip2, imageView);
} else {

相关文章