當前位置: 首頁>>代碼示例>>Java>>正文


Java Label.setMaxHeight方法代碼示例

本文整理匯總了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;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:27,代碼來源:HelloCalendarSelector.java

示例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;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:24,代碼來源:HelloTimeRangeView.java

示例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;
}
 
開發者ID:PolyphasicDevTeam,項目名稱:NoMoreOversleeps,代碼行數:10,代碼來源:JavaFxHelper.java

示例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.");
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:15,代碼來源:CalendarFXSamplerWelcome.java

示例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);
}
 
開發者ID:Bios-Marcel,項目名稱:ServerBrowser,代碼行數:8,代碼來源:ServerListController.java

示例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();
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:42,代碼來源:MonthEntryViewSkin.java


注:本文中的javafx.scene.control.Label.setMaxHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。