本文整理汇总了Java中javafx.scene.control.PasswordField.setMaxSize方法的典型用法代码示例。如果您正苦于以下问题:Java PasswordField.setMaxSize方法的具体用法?Java PasswordField.setMaxSize怎么用?Java PasswordField.setMaxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.PasswordField
的用法示例。
在下文中一共展示了PasswordField.setMaxSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PasswordFieldSample
import javafx.scene.control.PasswordField; //导入方法依赖的package包/类
public PasswordFieldSample() {
PasswordField passwordFiled = new PasswordField();
passwordFiled.setMaxSize(250, 250);
VBox root = new VBox();
root.getChildren().addAll(passwordFiled, new Button("Click Me!!"));
getChildren().add(root);
}
示例2: createObject
import javafx.scene.control.PasswordField; //导入方法依赖的package包/类
protected Object createObject(double width, double height) {
PasswordField passwordField = new PasswordField();
passwordField.setText(text);
passwordField.setMinSize(width, height);
passwordField.setPrefSize(width, height);
passwordField.setMaxSize(width, height);
return passwordField;
}
示例3: showChangedPassword
import javafx.scene.control.PasswordField; //导入方法依赖的package包/类
public void showChangedPassword()
{
changepass= new Stage();
changepass.setTitle("Change Password");
changepass.initModality(Modality.APPLICATION_MODAL);
changepass.getIcons().add(new Image("/pic/slogo.png"));
lname= new Label("Username");
txtusername= new TextField();
txtusername.setText(MainWindow.lname.getText());
txtusername.setEditable(false);
txtusername.setMaxSize(250, 100);
lnew= new Label("New Password");
newpass= new PasswordField();
newpass.setPromptText("new password");
newpass.setMaxSize(250, 100);
btnsave= new Button("Save");
btnsave.setOnAction(e ->{
setChangePass();
});
btnclose= new Button("Close");
btnclose.setOnAction(e ->{
changepass.close();
});
VBox lay1= new VBox(23);
lay1.getChildren().addAll(lname, lnew);
VBox lay2= new VBox(10);
lay2.getChildren().addAll(txtusername, newpass);
HBox laydet= new HBox(10);
laydet.setAlignment(Pos.CENTER);
laydet.setPadding(new Insets(10,10,10,10));
laydet.setBorder(new Border(new BorderStroke(Color.LIGHTGREY, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT)));
laydet.getChildren().addAll(lay1, lay2);
HBox laybtn= new HBox(10);
laybtn.setAlignment(Pos.CENTER_RIGHT);
laybtn.getChildren().addAll(btnsave, btnclose);
VBox layall= new VBox(10);
layall.setPadding(new Insets(10,10,10,10));
layall.getChildren().addAll(laydet, laybtn);
layall.setStyle("-fx-background-color: linear-gradient(#E4E9A9, #9CD777);");
scene1= new Scene(layall);
scene1.getStylesheets().add(ChangePassword.class.getResource("users.css").toExternalForm());
changepass.setScene(scene1);
changepass.setResizable(false);
changepass.show();
}