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


Java Label.setMinWidth方法代碼示例

本文整理匯總了Java中javafx.scene.control.Label.setMinWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setMinWidth方法的具體用法?Java Label.setMinWidth怎麽用?Java Label.setMinWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Label的用法示例。


在下文中一共展示了Label.setMinWidth方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initializeLabel

import javafx.scene.control.Label; //導入方法依賴的package包/類
private void initializeLabel() {
    LoggerFacade.getDefault().trace(this.getClass(), "Initialize Label"); // NOI18N
    
    lSign = new Label();
    lSign.setPadding(DEFAULT_PADDING);
    lSign.setMinWidth(26.0d);
    lSign.setStyle("-fx-background-color:POWDERBLUE"); // NOI18N
    lSign.setOnMouseClicked(event -> {
        if (event.getClickCount() == 2) {
            final Term term = new Term();
            term.setTitle("" + System.currentTimeMillis()); // NOI18N
            this.onActionAddTerm(term);
        }
    });
    
    super.getChildren().add(0, lSign);
}
 
開發者ID:Naoghuman,項目名稱:ABC-List,代碼行數:18,代碼來源:SignFlowPane.java

示例2: LabelContainer

import javafx.scene.control.Label; //導入方法依賴的package包/類
public LabelContainer(int labelIndex, int bahnsteig, ArrayList<LabelContainer> labelTime) throws Exception{
    this.labelTime = labelTime;
    this.bahnsteig = bahnsteig;
    this.labelIndex = labelIndex;
    trains = new ArrayList<>();
    hervorhebungDurchGleis = false;

    l = new Label();
    l.setFont(Font.font(settingsFontSize-5));
    l.setMinWidth(settingsGridWidth);
    l.setMaxWidth(settingsGridWidth);
    l.setAlignment(Pos.CENTER);

    if(bahnsteig > -1){
        updateLabel();
    }
}
 
開發者ID:manuel3108,項目名稱:Gleisbelegung,代碼行數:18,代碼來源:LabelContainer.java

示例3: AddPropertiesView

import javafx.scene.control.Label; //導入方法依賴的package包/類
public AddPropertiesView(TestPropertiesInfo issueInfo) {
    this.issueInfo = issueInfo;
    initComponents();
 // @formatter:off
    Label severityLabel = new Label("Severity: ");
    severityLabel.setMinWidth(Region.USE_PREF_SIZE);
    tmsLink.setOnAction((e) -> {
        try {
            Desktop.getDesktop().browse(new URI(tmsLink.getText()));
        } catch (Exception e1) {
            FXUIUtils._showMessageDialog(null, "Unable to open link: " + tmsLink.getText(), "Unable to open link",
                    AlertType.ERROR);
            e1.printStackTrace();
        }
    });
    formPane.addFormField("Name: ", nameField)
            .addFormField("Description: ", descriptionField)
            .addFormField("ID: ", idField, severityLabel, severities);
    String tmsPattern = System.getProperty(Constants.PROP_TMS_PATTERN);
    if (tmsPattern != null && tmsPattern.length() > 0) {
        tmsLink.textProperty().bind(Bindings.format(tmsPattern, idField.textProperty()));
        formPane.addFormField("", tmsLink);
    }
    // @formatter:on
    setCenter(content);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:27,代碼來源:AddPropertiesView.java

示例4: createBrowserField

import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createBrowserField() {
    HBox browseFieldBox = new HBox(5);
    dirField = new TextField();
    dirField.setId("DirectoryField");
    dirField.textProperty().addListener((observable, oldValue, newValue) -> updateOKButton());
    HBox.setHgrow(dirField, Priority.ALWAYS);
    Button browseButton = FXUIUtils.createButton("browse", "Browse directory", true, "Browse");
    FileSelectionHandler browserListener;
    String fileType = fileSelectionInfo.getFileType();
    if (fileType != null) {
        browserListener = new FileSelectionHandler(this,
                new ExtensionFilter(fileType, Arrays.asList(fileSelectionInfo.getExtensionFilters())), this, null,
                fileSelectionInfo.getTitle());
    } else {
        browserListener = new FileSelectionHandler(this, null, this, null, fileSelectionInfo.getTitle());
        browserListener.setMode(FileSelectionHandler.DIRECTORY_CHOOSER);
    }
    browserListener.setPreviousDir(new File(System.getProperty(Constants.PROP_PROJECT_DIR, ProjectLayout.projectDir)));
    browseButton.setOnAction(browserListener);
    Label label = createLabel("Name: ");
    label.setMinWidth(Region.USE_PREF_SIZE);
    label.setId("FileSelectedLabel");
    browseFieldBox.getChildren().addAll(label, dirField, browseButton);
    VBox.setMargin(browseFieldBox, new Insets(5, 5, 5, 5));
    return browseFieldBox;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:27,代碼來源:FileSelectionStage.java

示例5: createHeader

import javafx.scene.control.Label; //導入方法依賴的package包/類
/**
 * Creates the header part for each cell. The header consists of a border pane
 * with the weekday label in the "left" position and the date label in the "right"
 * position.
 *
 * @return the header node
 */
protected Node createHeader() {
    headerPane = new BorderPane();
    headerPane.getStyleClass().add(AGENDA_VIEW_HEADER);
    headerPane.setVisible(headerPaneVisible);
    headerPane.managedProperty().bind(headerPane.visibleProperty());

    weekdayLabel = new Label();
    weekdayLabel.getStyleClass().add(AGENDA_VIEW_WEEKDAY_LABEL);
    weekdayLabel.setMinWidth(0);

    dateLabel = new Label();
    dateLabel.setMinWidth(0);
    dateLabel.getStyleClass().add(AGENDA_VIEW_DATE_LABEL);

    headerPane.setLeft(weekdayLabel);
    headerPane.setRight(dateLabel);

    return headerPane;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:27,代碼來源:AgendaView.java

示例6: createLeftHandSide

import javafx.scene.control.Label; //導入方法依賴的package包/類
protected Node createLeftHandSide() {
    DayPage dayPage = getSkinnable();

    // today label
    todayLabel = new Label();
    todayLabel.getStyleClass().add("today-label"); //$NON-NLS-1$
    todayLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    todayLabel.setAlignment(Pos.TOP_LEFT);
    todayLabel.setTextOverrun(OverrunStyle.CLIP);
    todayLabel.setMinWidth(Region.USE_PREF_SIZE);
    HBox.setHgrow(todayLabel, Priority.ALWAYS);

    // year month view
    yearMonthView = dayPage.getYearMonthView();
    yearMonthView.setSelectionMode(SelectionMode.SINGLE);
    yearMonthView.setShowMonth(false);
    yearMonthView.setShowYear(false);
    yearMonthView.setShowTodayButton(false);
    HBox.setHgrow(yearMonthView, Priority.NEVER);
    getSkinnable().bind(yearMonthView, true);

    HBox header = new HBox(10);
    header.setFillHeight(true);
    header.getChildren().addAll(todayLabel, yearMonthView);
    header.getStyleClass().add("header");

    AgendaView agendaView = dayPage.getAgendaView();
    getSkinnable().bind(agendaView, true);
    HBox.setMargin(agendaView, new Insets(10, 0, 0, 0));

    BorderPane leftHandSide = new BorderPane();
    leftHandSide.getStyleClass().add("left-side");
    leftHandSide.setTop(header);
    leftHandSide.setCenter(agendaView);
    HBox.setHgrow(leftHandSide, Priority.ALWAYS);
    return leftHandSide;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:38,代碼來源:DayPageSkin.java

示例7: disableCheckboxOffset

import javafx.scene.control.Label; //導入方法依賴的package包/類
/**
 * Disable the offset of checkbox control.
 */
@FXThread
public void disableCheckboxOffset() {

    final CheckBox checkBox = getCheckBox();
    checkBox.prefWidthProperty().unbind();

    final Label propertyNameLabel = getPropertyNameLabel();
    propertyNameLabel.maxWidthProperty().unbind();
    propertyNameLabel.setMaxWidth(Region.USE_COMPUTED_SIZE);
    propertyNameLabel.prefWidthProperty().bind(widthProperty());
    propertyNameLabel.minWidthProperty().unbind();
    propertyNameLabel.setMinWidth(Region.USE_COMPUTED_SIZE);
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:17,代碼來源:BooleanPropertyControl.java

示例8: addRow

import javafx.scene.control.Label; //導入方法依賴的package包/類
private static int addRow(String name, Node content, GridPane grid, int row) {
	Label label = new Label(name+":");
	label.setMinWidth(Label.USE_PREF_SIZE);
	grid.add(label, 0, row);
	GridPane.setValignment(label, VPos.TOP);

	grid.add(content, 1, row);

	return row + 1;
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:11,代碼來源:MethodInfoTab.java

示例9: createRubyHomeField

import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createRubyHomeField() {
    HBox rubyHomeBox = new HBox(5);
    rubyHomeField = new TextField();
    rubyHomeField.setId("RubyHomeField");
    rubyHomeField.setPromptText("(Bundled JRuby)");
    Label label = createLabel("Ruby Home: ");
    label.setId("RubyLabel");
    label.setMinWidth(Region.USE_PREF_SIZE);
    rubyHomeBox.getChildren().addAll(label, rubyHomeField);
    HBox.setHgrow(rubyHomeField, Priority.ALWAYS);
    return rubyHomeBox;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:13,代碼來源:RubyPathLayout.java

示例10: CircularDirectionIndicator

import javafx.scene.control.Label; //導入方法依賴的package包/類
public CircularDirectionIndicator(String name, double radius){
	this.name = name;
	this.radius = radius;
	
	root = new VBox();
	
	StackPane graphicalData = new StackPane();
	graphicalData.setMaxSize(radius * 2, radius * 2);
	lineBox = new Canvas();
	
	outerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius);
	outerCircle.setFill(Color.TRANSPARENT);
	outerCircle.setStroke(Color.BLACK);
	/*innerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius * 0.5);
	innerCircle.setFill(Color.TRANSPARENT);
	innerCircle.setStroke(Color.BLACK);*/
	
	lineBox.setWidth(radius * 2);
	lineBox.setHeight(radius * 2);
	
	graphicalData.getChildren().addAll(outerCircle, lineBox);
	
	valLbl = new Label(name+": 0.0");
	valLbl.setMinWidth(radius * 2);
	valLbl.setTextAlignment(TextAlignment.CENTER);
	
	HBox labalBox = new HBox();
	labalBox.getChildren().add(valLbl);
	labalBox.setAlignment(Pos.CENTER);
	
	root.setAlignment(Pos.CENTER);
	root.setSpacing(2.0);
	root.getChildren().addAll(labalBox, graphicalData);
	
	setValue(0);
}
 
開發者ID:Flash3388,項目名稱:FlashLib,代碼行數:37,代碼來源:CircularDirectionIndicator.java

示例11: 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

示例12: createIconLabel

import javafx.scene.control.Label; //導入方法依賴的package包/類
public static Label createIconLabel(GlyphIcons icon, String iconSize, String text, ContentDisplay contentDisplay, Paint colour, String style, Pos alignment, int width)
{
	Text iconLabel = GlyphsDude.createIcon(icon, iconSize);
	iconLabel.setFill(colour);
	Label label = new Label(text);
	label.setTextFill(colour);
	label.setStyle(style);
	label.setGraphic(iconLabel);
	label.setContentDisplay(contentDisplay);
	label.setMinWidth(width);
	label.setMaxWidth(width);
	label.setAlignment(alignment);
	return label;
}
 
開發者ID:PolyphasicDevTeam,項目名稱:NoMoreOversleeps,代碼行數:15,代碼來源:JavaFxHelper.java

示例13: createLastBuildInfoBox

import javafx.scene.control.Label; //導入方法依賴的package包/類
private HBox createLastBuildInfoBox( final TileViewModel build ) {
    final HBox lastBuildInfoPart = new HBox( );
    lastBuildInfoPart.setAlignment( Pos.CENTER );

    final ImageView lastBuildIcon = new ImageView( UIUtils.createImage( "icons/lastBuild.png" ) );
    lastBuildIcon.setPreserveRatio( true );
    lastBuildIcon.setFitWidth( 32 );

    final Label lastBuildDate = new Label( );
    lastBuildDate.setMinWidth( 110 );
    lastBuildDate.setTextAlignment( CENTER );
    lastBuildDate.setAlignment( Pos.CENTER );
    lastBuildDate.setFont( UIUtils.font( 32, FontWeight.BOLD ) );
    lastBuildDate.setTextFill( Color.WHITE );
    lastBuildDate.setWrapText( true );
    lastBuildDate.setLineSpacing( 2 );  // TODO: Seems do not work
    lastBuildDate.setEffect( UIUtils.shadowEffect( ) );
    lastBuildDate.textProperty( ).bind( createStringBinding( ( ) -> {
        final LocalDateTime localDateTime = build.lastFinishedDateProperty( ).get( );
        if ( localDateTime == null )
            return "00/00\n00:00";
        return localDateTime.format( DateTimeFormatter.ofPattern( "dd/MM\nHH:mm" ) );
    }, build.lastFinishedDateProperty( ) ) );

    lastBuildInfoPart.getChildren( ).addAll( lastBuildIcon, lastBuildDate );
    return lastBuildInfoPart;
}
 
開發者ID:u2032,項目名稱:wall-t,代碼行數:28,代碼來源:TileView.java

示例14: addListElement

import javafx.scene.control.Label; //導入方法依賴的package包/類
public void addListElement(final String s) {
    final Label label = new Label(s);

    label.setStyle("-fx-padding: 8 16 8 16;");
    label.getStyleClass().add("body2");
    label.setMinWidth(width);

    list.getChildren().add(label);

    label.setOnMouseEntered(event -> canIShowSubMenu.set(false));
}
 
開發者ID:ulriknyman,項目名稱:H-Uppaal,代碼行數:12,代碼來源:DropDownMenu.java

示例15: refreshView

import javafx.scene.control.Label; //導入方法依賴的package包/類
@Override
public void refreshView()
{
	lines.clear();
	StackShowList.getChildren().clear();
	ArrayList<String> names = new ArrayList<String>();
	int dataLength = 8;
	
		names.clear();

		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
		names.add("first Doorlocal");
		names.add("second Doorlocal");
		names.add("third Doorlocal");
		names.add("fourth Doorlocal");
	
	
	for(int i = 0; i < dataLength; i++)
	{
		int counter = i;
		HBox entry = new HBox();
		Label lblServerDoor = new Label(names.get(i));
		lblServerDoor.setPadding(new Insets(15,0,0,250));
		lblServerDoor.setMinWidth(590);
		AppButton btnMerge = new AppButton("Overwrite");
		AppButton btnInformation = new AppButton("i");
		btnInformation.setOnAction(e ->
		{
			ArrayList<String> list = new ArrayList<String>();
			list.add(names.get(counter));
			getFXController().getModel("doorstackinformationmodel").setDataList(list);				
			getFXController().showView("doorstackinformationview");
		}
		);
		

		entry.getChildren().addAll(lblServerDoor,btnInformation,btnMerge);
		lines.add(entry);
	}
	
	for(HBox l : lines)
	{
		StackShowList.getChildren().add(l);
	}
	
}
 
開發者ID:CoffeeCodeSwitzerland,項目名稱:Lernkartei_2017,代碼行數:58,代碼來源:SaveDownloaddoorOwnDMOView.java


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