本文整理汇总了Java中javafx.scene.control.Label.setMaxHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setMaxHeight方法的具体用法?Java Label.setMaxHeight怎么用?Java Label.setMaxHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setMaxHeight方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControl
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
protected Node createControl() {
Calendar meetings = new Calendar("Meetings");
Calendar training = new Calendar("Training");
Calendar customers = new Calendar("Customers");
Calendar holidays = new Calendar("Holidays");
meetings.setStyle(Style.STYLE2);
training.setStyle(Style.STYLE3);
customers.setStyle(Style.STYLE4);
holidays.setStyle(Style.STYLE5);
CalendarSelector view = new CalendarSelector();
view.getCalendars().addAll(meetings, training, customers, holidays);
view.setCalendar(meetings);
Label label = new Label("Selected: " + view.getCalendar().getName());
label.setMaxHeight(Double.MAX_VALUE);
view.calendarProperty().addListener(it -> label.setText("Selected: " + view.getCalendar().getName()));
HBox box = new HBox(20);
box.setFillHeight(true);
box.getChildren().addAll(view, label);
return box;
}
示例2: wrap
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
protected Node wrap(Node node) {
TimeRangeView field = (TimeRangeView) node;
Label label = new Label("Range: " + field.getStartDate() + " to " + field.getEndDate());
label.setMaxHeight(Double.MAX_VALUE);
field.startDateProperty().addListener(it -> label.setText("Range: " + field.getStartDate() + " to " + field.getEndDate()));
field.endDateProperty().addListener(it -> label.setText("Range: " + field.getStartDate() + " to " + field.getEndDate()));
VBox box2 = new VBox(20, field, label);
box2.setFillWidth(false);
StackPane stackPane = new StackPane();
stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
stackPane.getChildren().add(box2);
HBox box = new HBox(stackPane);
box.setStyle("-fx-padding: 100px;");
box.setAlignment(Pos.CENTER);
box.setFillHeight(false);
return box;
}
示例3: createLabel
import javafx.scene.control.Label; //导入方法依赖的package包/类
public static Label createLabel(String text, Paint colour, String style, Insets insets, double width, double height)
{
Label label = createLabel(text, colour, style, insets);
label.setMinWidth(width);
label.setMaxWidth(width);
label.setMinHeight(height);
label.setMaxHeight(height);
return label;
}
示例4: CalendarFXSamplerWelcome
import javafx.scene.control.Label; //导入方法依赖的package包/类
public CalendarFXSamplerWelcome() {
super("CalendarFX", new Label(""));
Label label = (Label) getContent();
label.setWrapText(true);
label.setMaxWidth(Double.MAX_VALUE);
label.setMaxHeight(Double.MAX_VALUE);
label.setTextAlignment(TextAlignment.CENTER);
label.setAlignment(Pos.CENTER);
label.setPadding(new Insets(50));
label.setText("Welcome to the CalendarFX sampler. This application allows you to quickly browse through the "
+ "various controls that are available in this framework. In each sample you can play around with the "
+ "properties and controls shown on the right-hand side.");
}
示例5: setupInfoLabel
import javafx.scene.control.Label; //导入方法依赖的package包/类
private static void setupInfoLabel(final Label label) {
label.setMaxHeight(Double.MAX_VALUE);
label.setMaxWidth(Double.MAX_VALUE);
label.setTextAlignment(TextAlignment.CENTER);
HBox.setHgrow(label, Priority.ALWAYS);
}
示例6: MonthEntryViewSkin
import javafx.scene.control.Label; //导入方法依赖的package包/类
public MonthEntryViewSkin(MonthEntryView view) {
super(view);
Entry<?> entry = view.getEntry();
if (entry.isRecurrence()) {
entry = entry.getRecurrenceSourceEntry();
}
Calendar calendar = entry.getCalendar();
colorDot = new Circle();
colorDot.setRadius(2.5);
colorDot.setMouseTransparent(true);
titleLabel = new Label();
titleLabel.setGraphic(colorDot);
titleLabel.setMinSize(0, 0);
titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
titleLabel.setMouseTransparent(true);
timeLabel = new Label();
timeLabel.setMouseTransparent(true);
timeLabel.setMaxHeight(Double.MAX_VALUE);
timeLabel.setMouseTransparent(true);
// update in these cases
entry.titleProperty().addListener(weakUpdateViewListener);
entry.fullDayProperty().addListener(weakUpdateViewListener);
entry.intervalProperty().addListener(weakUpdateViewListener);
entry.calendarProperty().addListener(weakUpdateViewListener);
view.positionProperty().addListener(weakUpdateViewListener);
if (calendar != null) {
calendar.styleProperty().addListener(weakUpdateViewListener);
}
getChildren().addAll(titleLabel, timeLabel);
updateView();
}