Package java.io

Examples of java.io.Console.printf()


    }

    public static void main(String[] args) {
        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
View Full Code Here


    }

    public static void main(String[] args) {
        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
View Full Code Here

    }

    public static void main(String[] args) {
        Console con = System.console();
        FootballManager manager = new FootballManager(System.console());
        con.printf(initialPrompt);

        while (true) {
            String action = con.readLine(">");
            if ("at".equals(action)) {
                manager.addTeam();
View Full Code Here

        return true;
      }
      if ("no".equalsIgnoreCase(line) || "n".equalsIgnoreCase(line)) {
        return false;
      }
      console.printf("# ERROR: Please answer yes or no\n#\n");
    }
  }
 
  @Override
  public boolean promptForIdentity(String message) {
View Full Code Here

  @Override
  public void showMessage(String message) {
    final Console console = System.console();
    showHeader(console);
    console.printf("# %s\n#\n", message);
  }
 
  private void showHeader(Console console) {
    if (headerShown) {
      return;
View Full Code Here

    if (!GraphicsEnvironment.isHeadless()) {
      return swingCredentialsDialog(title, description, username, password);
    }

    final Console console = System.console();
    console.printf("#\n# %s\n# %s\n#\n", title, description);
    final String user = console.readLine("# %s: ", username);
    final char[] pass = console.readPassword("# %s: ", password);
    console.printf("#\n");

    return new String[] { user, new String(pass) };
View Full Code Here

    final Console console = System.console();
    console.printf("#\n# %s\n# %s\n#\n", title, description);
    final String user = console.readLine("# %s: ", username);
    final char[] pass = console.readPassword("# %s: ", password);
    console.printf("#\n");

    return new String[] { user, new String(pass) };
  }

  private static String[] swingCredentialsDialog(String title, String description, String username, String password) {
View Full Code Here

                        + (((obfuscate || encode) ? " (enter as plain text): " : ": "))));
                    if (propertyValue.equals(confirmValue)) {
                        response = "yes";
                    } else {
                        response = "no";
                        console.printf("Did not match. Please try again.\n");
                    }
                }
            } while (response.startsWith("n"));

            propertyValue = obfuscate ? Obfuscator.encode(propertyValue) : propertyValue;
View Full Code Here

         */
        if (programOpts.getUser() == null) {
            // prompt for it (if interactive)
            Console cons = System.console();
            if (cons != null && programOpts.isInteractive()) {
                cons.printf("%s", strings.get("AdminUserDefaultPrompt",
                    SystemPropertyConstants.DEFAULT_ADMIN_USER));
                String val = cons.readLine();
                if (ok(val))
                    programOpts.setUser(val);
                else
View Full Code Here

         */
        if (programOpts.getUser() == null && !noPassword) {
            // prompt for it (if interactive)
            Console cons = System.console();
            if (cons != null && programOpts.isInteractive()) {
                cons.printf("%s", strings.get("AdminUserRequiredPrompt",
                        SystemPropertyConstants.DEFAULT_ADMIN_USER));
                String val = cons.readLine();
                if (ok(val)) {
                    programOpts.setUser(val);
                    if (adminPassword == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.