本文整理汇总了Java中javafx.scene.control.TextField.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.setStyle方法的具体用法?Java TextField.setStyle怎么用?Java TextField.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TextField
的用法示例。
在下文中一共展示了TextField.setStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HomeTab
import javafx.scene.control.TextField; //导入方法依赖的package包/类
public HomeTab(Button button, Pane pane, TextField connectionStatus, TextArea console) {
super(button, pane);
this.connectionStatus = connectionStatus;
this.console = console;
// set connection status to red, because no connection exists
connectionStatus.setText(NOT_CONNECTED);
connectionStatus.setStyle("-fx-text-inner-color: red;");
// register this as event listener
EventExecutor.getInstance().register(this);
}
示例2: setFieldStyle
import javafx.scene.control.TextField; //导入方法依赖的package包/类
private void setFieldStyle(TextField aTextField, FieldType aType) {
switch (aType) {
case READ_ONLY:
aTextField.setEditable(false);
aTextField.setStyle(FxStyle.READ_ONLY);
break;
case ERRONEOUS:
aTextField.setEditable(false);
aTextField.setStyle(FxStyle.READ_ONLY_ERROR);
break;
default:
aTextField.setEditable(true);
break;
}
}
示例3: getActionPane
import javafx.scene.control.TextField; //导入方法依赖的package包/类
private VBox getActionPane(){
progress= new Text("Office\nEntry Progress");
progress.setTextAlignment(TextAlignment.CENTER);
progress.setFont(Font.font("Times New Roman", 35));
lname= new Label("-Your Name here-");
Image iconf= new Image(Office_Entry.class.getResourceAsStream("/pic/finger.png"));
ImageView ivconf= new ImageView(iconf);
lpic= new Label();
lpic.setGraphic(ivconf);
Image img1= new Image(PersonalReports.class.getResourceAsStream("/pic/cross.png"));
ImageView imagvw= new ImageView(img1);
imagvw.setFitHeight(70);
imagvw.setFitWidth(70);
lnotexist= new Label("",imagvw);
lnotexist.setText("\n\n\n\n\nN/A");
lnotexist.setFont(Font.font("Cooper Black", 15));
lnotexist.setVisible(false);
txtfinger= new TextField();
txtfinger.setEditable(false);
txtfinger.setMaxWidth(160);
txtfinger.setStyle("-fx-background-radius:10; -fx-background-color:#9CD777;");
txtsearch= new TextField();
initFilter();
Button btnView= new Button("View Records");
Button btnCloseView= new Button("Hide Records");
Button btnadd= new Button("save");
btnadd.setOnAction(e -> {
setAddAttendance();
});
btnView.setOnAction(e -> {
timelineDown.play();
});
btnCloseView.setOnAction(e -> {
timelineUp.play();
});
VBox laywrong= new VBox();
laywrong.getChildren().addAll(lnotexist);
laywrong.setPadding(new Insets(0,0,0,0));
laywrong.setAlignment(Pos.CENTER);
HBox laytest= new HBox(5);
laytest.getChildren().addAll(txtfinger /* btnadd*/);
laytest.setAlignment(Pos.CENTER);
VBox laybtnsearch= new VBox();
laybtnsearch.getChildren().addAll(txtsearch);
laybtnsearch.setAlignment(Pos.CENTER);
laybtnsearch.setPadding(new Insets(20,0,0,0));
HBox laybtn= new HBox(5);
laybtn.getChildren().addAll(btnView, btnCloseView);
laybtn.setAlignment(Pos.CENTER);
VBox lay1= new VBox(10);
lay1.getChildren().addAll(progress, lpic, lname, laytest);
lay1.setAlignment(Pos.CENTER);
VBox layside= new VBox(25);
layside.getChildren().addAll(lay1, laybtn, laybtnsearch, laywrong);
layside.setAlignment(Pos.TOP_CENTER);
layside.setMinWidth(230);
layside.setPadding(new Insets(20,0,10,0));
return layside;
}
示例4: getActionPane
import javafx.scene.control.TextField; //导入方法依赖的package包/类
private VBox getActionPane(){
progress= new Text("Gate\nEntry Progress");
progress.setTextAlignment(TextAlignment.CENTER);
progress.setFont(Font.font("Times New Roman", 35));
lname= new Label("-Your Name here-");
Image iconf= new Image(AllAttendance.class.getResourceAsStream("/pic/finger.png"));
ImageView ivconf= new ImageView(iconf);
lpic= new Label();
lpic.setGraphic(ivconf);
Image img1= new Image(PersonalReports.class.getResourceAsStream("/pic/cross.png"));
ImageView imagvw= new ImageView(img1);
imagvw.setFitHeight(70);
imagvw.setFitWidth(70);
lnotexist= new Label("",imagvw);
lnotexist.setText("\n\n\n\n\nN/A");
lnotexist.setFont(Font.font("Cooper Black", 15));
lnotexist.setVisible(false);
txtfinger= new TextField();
txtfinger.setEditable(false);
txtfinger.setMaxWidth(160);
txtfinger.setStyle("-fx-background-radius:10; -fx-background-color:#9CD777;");
txtsearch= new TextField();
initFilter();
Button btnadd= new Button("save");
btnadd.setOnAction(e -> {
setAddAttendance();
});
Button btnView= new Button("View Records");
Button btnCloseView= new Button("Hide Records");
btnView.setOnAction(e -> {
timelineDown.play();
});
btnCloseView.setOnAction(e -> {
timelineUp.play();
});
VBox laywrong= new VBox();
laywrong.getChildren().addAll(lnotexist);
laywrong.setPadding(new Insets(0,0,0,0));
laywrong.setAlignment(Pos.CENTER);
HBox laytest= new HBox(5);
laytest.getChildren().addAll(txtfinger /* btnadd*/);
laytest.setAlignment(Pos.CENTER);
//btnadd was beside txtfinger
VBox laybtnsearch= new VBox();
laybtnsearch.getChildren().addAll(txtsearch);
laybtnsearch.setAlignment(Pos.CENTER);
laybtnsearch.setPadding(new Insets(20,0,0,0));
HBox laybtn= new HBox(5);
laybtn.getChildren().addAll(btnView, btnCloseView);
laybtn.setAlignment(Pos.CENTER);
VBox lay1= new VBox(10);
lay1.getChildren().addAll(progress, lpic, lname, laytest);
lay1.setAlignment(Pos.CENTER);
VBox layside= new VBox(25);
layside.getChildren().addAll(lay1, laybtn, laybtnsearch, laywrong);
layside.setAlignment(Pos.TOP_CENTER);
layside.setMinWidth(230);
layside.setPadding(new Insets(20,0,10,0));
return layside;
}