本文整理了Java中javafx.scene.control.Label.setId()
方法的一些代码示例,展示了Label.setId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setId()
方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:setId
暂无
代码示例来源:origin: org.controlsfx/controlsfx
/**
* Constructs a new dual list view.
*/
public ListSelectionView() {
getStyleClass().add(DEFAULT_STYLECLASS);
Label sourceHeader = new Label(
localize(asKey("listSelectionView.header.source")));
sourceHeader.getStyleClass().add("list-header-label");
sourceHeader.setId("source-header-label");
setSourceHeader(sourceHeader);
Label targetHeader = new Label(
localize(asKey("listSelectionView.header.target")));
targetHeader.getStyleClass().add("list-header-label");
targetHeader.setId("target-header-label");
setTargetHeader(targetHeader);
}
代码示例来源:origin: PhoenicisOrg/phoenicis
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
WebView webView = new WebView();
VBox.setVgrow(webView, Priority.ALWAYS);
webView.getEngine().loadContent(htmlToShow);
final URL style = getClass().getResource(String.format("/org/phoenicis/javafx/themes/%s/description.css",
getParent().getThemeManager().getCurrentTheme().getShortName()));
webView.getEngine().setUserStyleSheetLocation(style.toString());
contentPane.getChildren().addAll(webView);
getParent().getRoot().setCenter(contentPane);
}
代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX
input.setId("transferLabel");
input.textProperty().bind(moneyTranfer.amountProperty().asString());
代码示例来源:origin: PhoenicisOrg/phoenicis
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
Text textWidget = new Text(textToShow);
textWidget.setId("presentationText");
TextFlow flow = new TextFlow();
flow.getChildren().add(textWidget);
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("presentationScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(flow);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
contentPane.getChildren().add(scrollPane);
getParent().getRoot().setCenter(contentPane);
}
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
header.setId("playerName");
Pane centerPane = dialogHelper.center(header);
代码示例来源:origin: com.github.giulianini.jestures/jestures
/**
* Create a {@link JFXListView} for the templates.
*
* @param listView
* the {@link JFXListView}
* @param imageProfile
* the {@link Image} profile
* @param index
* the {@link Integer} index
*/
// CHECKSTYLE:OFF AH DI MI TOCCA FARE COSI
public static void addVectorToListView(final JFXListView<BorderPane> listView, final Image imageProfile,
final int index) {
final BorderPane pane = new BorderPane();
final Label label = new Label(" " + index);
final ImageView imageView = new ImageView(imageProfile);
JFXDepthManager.setDepth(pane, 1);
label.setId("player-listView-label");
pane.setId("player-listView-border");
imageView.setFitHeight(150);
imageView.setFitWidth(200);
BorderPane.setAlignment(imageView, Pos.CENTER);
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
pane.setCenter(imageView);
pane.setLeft(label);
listView.getItems().add(pane);
listView.scrollTo(index);
}
// CHECKSTYLE:ON
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
imgView.setId("minusIcon");
final Label input = new Label();
input.setId("headTaxLabel");
input.setText(String.valueOf(cityHallAccessor.getCityHall(city.getCity()).getTreasury().getCurrentHeadTaxValue()));
imgView.setOnMouseReleased((e) -> {
imgView.setId("minusIcon");
final Label input = new Label();
input.setId("specialTaxLabel");
input.setText("0");
imgView.setOnMouseReleased((e) -> {
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
this.minButton.visibleProperty().bind(minimizableProperty());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
maxButton.visibleProperty().bind(maximizableProperty());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
public TitleAreaNodeImpl() {
getStyleClass().add("window-header"); //$NON-NLS-1$
setPrefHeight(HEADER_HEIGHT);
setMinHeight(HEADER_HEIGHT);
setMaxHeight(HEADER_HEIGHT);
this.titleLabel = new Label();
this.titleLabel.setMaxHeight(Double.MAX_VALUE);
this.titleLabel.setId("window-label-title"); //$NON-NLS-1$
this.titleLabel.getStyleClass().add("window-title"); //$NON-NLS-1$
Region spacer = new Region();
HBox.setHgrow(spacer, Priority.ALWAYS);
// add close min max
WindowButton closeButton = new WindowButton("close"); //$NON-NLS-1$
closeButton.setFocusTraversable(false);
closeButton.setOnAction(e -> requestCancelClose());
this.minButton = new WindowButton("minimize"); //$NON-NLS-1$
this.minButton.setFocusTraversable(false);
this.minButton.setOnAction(e -> minimize());
this.minButton.visibleProperty().bind(minimizableProperty());
WindowButton maxButton = new WindowButton("maximize"); //$NON-NLS-1$
maxButton.setFocusTraversable(false);
maxButton.setOnAction(e -> maximize());
maxButton.visibleProperty().bind(maximizableProperty());
HBox windowBtns = new HBox(3);
windowBtns.getStyleClass().add("window-buttons"); //$NON-NLS-1$
windowBtns.getChildren().addAll(this.minButton, maxButton, closeButton);
getChildren().addAll(this.titleLabel, spacer, windowBtns);
}
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
initializeRequirements();
titleLbl = new Label();
titleLbl.setId("title");
titleLbl.getStyleClass().add("dialogText");
String shipType = getTitleText();
代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX
backLbl.setId(getClass().getName() + "backButton");
backLbl.fontProperty().bind(control.navigationLabelFontProperty());
backLbl.textProperty().bind(control.backButtonLabelProperty());
backLbl.setPadding(defaultInsets);
nextLbl = new Label();
nextLbl.setId(getClass().getName() + "nextButton");
nextLbl.fontProperty().bind(control.navigationLabelFontProperty());
nextLbl.textProperty().bind(control.nextButtonLabelProperty());
代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay
sailorsOnShip2.setId("crew");
sailorsOnShip2.getStyleClass().add("dialogText");
final SimpleSailorOnShipBinding sailorsOnShipBinding = new SimpleSailorOnShipBinding(currentShip);
内容来源于网络,如有侵权,请联系作者删除!