本文整理匯總了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();
}