本文整理汇总了Java中javafx.scene.control.Label.setId方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setId方法的具体用法?Java Label.setId怎么用?Java Label.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructContainer
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Parent constructContainer ()
{
headLbl = new Label("Umbenennen");
headLbl.setId("bold");
AppButton backBtn = new AppButton("_Zur�ck");
backBtn.setOnAction(e -> getFXController().showView("doorview"));
BorderPane headLayout = new BorderPane(headLbl);
headLayout.setPadding(new Insets(0, 0, 25, 0));
renameLayout.setPadding(new Insets(10));
renameLayout.setAlignment(Pos.TOP_CENTER);
scroller.setMaxWidth(600);
scroller.setFitToWidth(true);
scroller.setPadding(new Insets(25));
MainLayout maLay = new MainLayout(scroller, headLayout, new ControlLayout(backBtn));
getFXController().getModel("stack").registerView(this);
return maLay;
}
示例2: initComponents
import javafx.scene.control.Label; //导入方法依赖的package包/类
public void initComponents() {
HBox bulrbTitleBox = createBlurbTitle();
Label companyLabel = createLabel(versionInfo.getBlurbCompany());
companyLabel.setId("companyName");
Label websiteLabel = createLabel(versionInfo.getBlurbWebsite());
websiteLabel.setId("websiteAddress");
Label creditsLabel = createLabel(versionInfo.getBlurbCredits());
creditsLabel.setId("creditsLabel");
infoBox.setId("infoBox");
infoBox.setAlignment(Pos.TOP_CENTER);
infoBox.getChildren().addAll(bulrbTitleBox, companyLabel, websiteLabel, creditsLabel);
creditsButton.setOnAction((e) -> onCredits());
okButton.setOnAction((e) -> onOK());
buttonBar.setId("buttonBar");
buttonBar.getButtons().addAll(creditsButton, okButton);
}
示例3: 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;
}
示例4: addFormField
import javafx.scene.control.Label; //导入方法依赖的package包/类
public FormPane addFormField(String text, Node... fields) {
Label label = new Label(text);
String labelId = idText(text);
label.setId(labelId);
GridPane.setValignment(label, VPos.TOP);
int column = 0;
add(label, column++, currentRow, 1, 1);
int colspan = columns - fields.length;
int fieldIndex = 1;
for (Node field : fields) {
field.setId(labelId + "-field-" + fieldIndex);
setFormConstraints(field);
GridPane.setValignment(field, VPos.TOP);
add(field, column++, currentRow, colspan, 1);
fieldIndex++;
}
currentRow++;
column = 0;
return this;
}
示例5: constructContainer
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Parent constructContainer ()
{
headLbl = new Label("");
headLbl.setId("bold");
BorderPane headLayout = new BorderPane(headLbl);
headLayout.setPadding(new Insets(25));
// Zur�ck Button
backBtn = new AppButton("_Zur�ck");
backBtn.setOnAction(e -> getFXController().showView("simpleeditorview"));
// Info Button
infobtn = new AppButton("Hilfe");
infobtn.setOnAction(e -> getFXController().showView("bbcodeinfo"));
// EditLayout
editLayout.setPadding(new Insets(10));
editLayout.setAlignment(Pos.TOP_CENTER);
// Controll Layout
ControlLayout conLay = new ControlLayout(backBtn, infobtn);
// Main Layout
MainLayout maLay = new MainLayout(editLayout, headLayout, conLay);
return maLay;
}
示例6: setOptions
import javafx.scene.control.Label; //导入方法依赖的package包/类
private void setOptions (String stack)
{
options.getChildren().clear();
Label stackTitle = new Label(stack);
AppButton lernen = new AppButton("Lernen");
AppButton edit = new AppButton("Bearbeiten");
// CheckBox switcher = new CheckBox("Seite 2 zuerst");
stackTitle.setId("bold");
stackTitle.setWrapText(true);
lernen.setOnAction(e ->
{
getFXController().setViewData("prelearn", stack);
getFXController().showView("prelearn");
});
edit.setOnAction(e ->
{
getFXController().setViewData("simpleeditorview", stack);
getFXController().showView("simpleeditorview");
});
/*
* switcher.setSelected(getFXController().getModel("switcher").doAction(
* "check", stack) == 1 ? true : false);
* switcher.selectedProperty().addListener(event -> { if
* (switcher.isSelected()) {
* getFXController().getModel("switcher").doAction("new", stack); } else
* { getFXController().getModel("switcher").doAction("delete", stack); }
* });
*/
//setString �bergibt string und kann durch getString wieder geholt werden
getFXController().getModel("drucken").setString(stack);
options.getChildren().addAll(stackTitle, lernen, edit, printBtn/* , switcher */);
}
示例7: info
import javafx.scene.control.Label; //导入方法依赖的package包/类
public Label info(String value) {
Label l = new Label(value);
l.setTextFill(Color.web("#FFFFFF"));
l.setId("oc-info-label");
l.setWrapText(true);
l.setTextAlignment(TextAlignment.JUSTIFY);
return l;
}
示例8: configureBox
import javafx.scene.control.Label; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
StackPane container = new StackPane();
//container.setPrefHeight(700);
container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");
table= new TableView<OfficeClass>();
Label lview= new Label();
lview.setText("View Records");
lview.setId("lview");
bottomPane= new VBox();
tclock= new Text();
tclock.setId("lview");
//tclock.setFont(Font.font("Calibri", 20));
final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
}
}));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
bottomPane.getChildren().addAll(tclock, lview);
bottomPane.setAlignment(Pos.CENTER);
nocol= new TableColumn<>("no");
nocol.setMinWidth(130);
nocol.setCellValueFactory(new PropertyValueFactory<>("no"));
namecol= new TableColumn<>("First Name");
namecol.setMinWidth(170);
namecol.setCellValueFactory(new PropertyValueFactory<>("name"));
admcol= new TableColumn<>("Admission Number");
admcol.setMinWidth(180);
admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));
timecol= new TableColumn<>("Signin");
timecol.setMinWidth(140);
timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));
datecol= new TableColumn<>("Date");
datecol.setMinWidth(180);
datecol.setCellValueFactory(new PropertyValueFactory<>("date"));
table.getColumns().addAll(nocol,namecol, admcol, timecol, datecol);
table.setItems(getAtt());
att= getAtt();
table.setItems(FXCollections.observableArrayList(att));
table.setMinHeight(500);
btnrefresh = new Button("Refresh");
btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
table.setItems(getAtt());
}
});
laytable= new VBox(10);
laytable.getChildren().addAll(table, btnrefresh);
laytable.setAlignment(Pos.TOP_LEFT);
container.getChildren().addAll(bottomPane,laytable);
setAnimation();
sc.setContent(container);
root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
root.getChildren().addAll(getActionPane(),sc);
//service.start();
}
示例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;
}
示例10: show
import javafx.scene.control.Label; //导入方法依赖的package包/类
public void show(){
Group root = new Group();
Scene scene = new Scene(root, WIDTH, HEIGHT);
scene.getStylesheets().setAll("/styleSheets/login.css");
Image backgroundImage = new Image(getClass().getClassLoader().getResourceAsStream(myResources.getString("loaderImagePath")));
scene.setFill(new ImagePattern(backgroundImage));
// Bind the timerLabel text property to the timeSeconds property
timerLabel.textProperty().bind(timeSeconds.divide(100).asString());
timerLabel.setId("label");
ProgressBar progressBar = new ProgressBar();
progressBar.progressProperty().bind(
timeSeconds.divide(START_TIME*100.0).subtract(1).multiply(-1));
timeSeconds.set((START_TIME)*100);
timelineController();
Label loadingLabel =new Label("Game loading ...");
loadingLabel.setId("label");
VBox vb = new VBox(20);
// center the components within VBox
vb.setAlignment(Pos.CENTER);
vb.setPrefWidth(scene.getWidth());
vb.setLayoutY(60);
vb.getChildren().addAll( timerLabel, progressBar, loadingLabel);
root.getChildren().add(vb);
scene.getStylesheets().setAll(CSS_LOCATION);
primaryStage.setScene(scene);
primaryStage.show();
}
示例11: createInfo
import javafx.scene.control.Label; //导入方法依赖的package包/类
private HBox createInfo() {
Label blurbLabel = createLabel(versionInfo.getBlurbTitle());
blurbLabel.setId("blurbLabel");
HBox infoBox = new HBox();
infoBox.getChildren().addAll(blurbLabel);
infoBox.setAlignment(Pos.TOP_CENTER);
return infoBox;
}
示例12: configureBox
import javafx.scene.control.Label; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void configureBox(HBox root) {
StackPane container = new StackPane();
//container.setPrefHeight(700);
container.setPrefSize(boxBounds.getWidth(), boxBounds.getHeight());
container.setStyle("-fx-border-width:1px;-fx-border-style:solid;-fx-border-color:#999999;");
table= new TableView<AttClass>();
Label lview= new Label();
lview.setText("View Records");
lview.setId("lview");
bottomPane= new VBox();
tclock= new Text();
tclock.setId("lview");
//tclock.setFont(Font.font("Calibri", 20));
final Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
tclock.setText(DateFormat.getDateTimeInstance().format(new Date()));
}
}));
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
bottomPane.getChildren().addAll(tclock,lview);
bottomPane.setAlignment(Pos.CENTER);
//table pane
namecol= new TableColumn<>("First Name");
namecol.setMinWidth(170);
namecol.setCellValueFactory(new PropertyValueFactory<>("name"));
admcol= new TableColumn<>("Identication No.");
admcol.setMinWidth(180);
admcol.setCellValueFactory(new PropertyValueFactory<>("adm"));
typecol= new TableColumn<>("Type");
typecol.setMinWidth(130);
typecol.setCellValueFactory(new PropertyValueFactory<>("type"));
timecol= new TableColumn<>("Signin");
timecol.setMinWidth(140);
timecol.setCellValueFactory(new PropertyValueFactory<>("timein"));
datecol= new TableColumn<>("Date");
datecol.setMinWidth(180);
datecol.setCellValueFactory(new PropertyValueFactory<>("date"));
table.getColumns().addAll(namecol, admcol, typecol, timecol, datecol);
table.setItems(getAtt());
att= getAtt();
table.setItems(FXCollections.observableArrayList(att));
table.setMinHeight(500);
btnrefresh = new Button("Refresh");
btnrefresh.setOnAction(new EventHandler<ActionEvent>() {
public void handle(ActionEvent t) {
table.setItems(getAtt());
}
});
laytable= new VBox(10);
laytable.getChildren().addAll(table, btnrefresh);
laytable.setAlignment(Pos.TOP_LEFT);
container.getChildren().addAll(bottomPane,laytable);
setAnimation();
sc.setContent(container);
root.setStyle("-fx-background-color: linear-gradient(#E4EAA2, #9CD672)");
root.getChildren().addAll(getActionPane(),sc);
//service.start();
}
示例13: constructContainer
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Parent constructContainer() {
webContent.loadContent("<html><body><b>Missing a manual</b></body></html>");
try {
// To avoid strange chars like "", the html -Tag is added here separately:
webContent.loadContent("<html>"+Functions.fileToString(new File(
"src/views/txt/troubleshoot.htm"))+"</html>");
} catch (Exception e) {
e.printStackTrace();
}
double pageWidth = this.getFXController().getMyFXStage().getOPTIMAL_WIDTH();
double pageHeight = this.getFXController().getMyFXStage().getOPTIMAL_HEIGHT();
debug.Debugger.out("ManualView sizes: w:"+pageWidth+" h:"+pageHeight);
//webPage.setPrefHeight(pageHeight);
webPage.setPrefWidth(pageWidth*.93);
//webContent.setJavaScriptEnabled(true);
webPage.applyCss();
Label labelTitel = new Label("Fehlerbehandlung");
labelTitel.setId("anleitungstitel");
BackButton backBtn = new BackButton(this.getFXController());
BorderPane headLayout = new BorderPane(labelTitel);
headLayout.setPadding(new Insets(20));
ScrollPane scroller = new ScrollPane();
scroller.setMaxWidth(pageWidth);
scroller.setContent(webPage);
scroller.setHbarPolicy(ScrollBarPolicy.NEVER);
scroller.setVbarPolicy(ScrollBarPolicy.ALWAYS);
scroller.setId("anleitung");
HBox controlLayout = new HBox(20);
controlLayout.setAlignment(Pos.BOTTOM_CENTER);
controlLayout.getChildren().addAll(backBtn);
controlLayout.setPadding(new Insets(10));
BorderPane mainLayout = new BorderPane();
mainLayout.setPadding(new Insets(15));
mainLayout.setTop(headLayout);
mainLayout.setCenter(scroller);
mainLayout.setBottom(controlLayout);
return mainLayout;
}
示例14: info
import javafx.scene.control.Label; //导入方法依赖的package包/类
public Label info(String value) {
Label l = new Label(value);
l.setId("oc-info-label");
return l;
}
示例15: constructContainer
import javafx.scene.control.Label; //导入方法依赖的package包/类
@Override
public Parent constructContainer() {
headLbl = new Label("");
headLbl.setId("bold");
HomeButton backBtn = new HomeButton(getFXController(), "_Zur�ck");
AppButton newDoorBtn = new AppButton(txtNewTheme);
Image trashImg = new Image("views/pictures/Papierkorb.png");
ImageView trashImgView = new ImageView(trashImg);
BorderPane headLayout = new BorderPane(headLbl);
headLayout.setPadding(new Insets(0, 0, 25, 0));
doorLayout.setPadding(new Insets(10));
doorLayout.setAlignment(Pos.TOP_CENTER);
scroller.setMaxWidth(600);
scroller.setFitToWidth(true);
scroller.setPadding(new Insets(25));
ControlLayout conLay = new ControlLayout(backBtn, newDoorBtn, trashImgView);
MainLayout maLay = new MainLayout(scroller, headLayout, conLay);
newDoorBtn.setOnAction(e ->
{
newDoor();
});
trashImgView.setOnDragOver(event ->
{
if (event.getGestureSource() != trashImgView && event.getDragboard().hasString())
{
event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
}
event.consume();
});
trashImgView.setOnDragDropped(event ->
{
Dragboard db = event.getDragboard();
boolean success = false;
if (db.hasString())
{
success = deleteDoor(db.getString());
}
event.setDropCompleted(success);
event.consume();
});
getFXController().getModel("cards").registerView(this);
return maLay;
}