Example #1
0
 /**
  * The constructor
  *
  * @param title dialog's title
  */
 public FileDialog(String title) {
   this(
       Toolkit.getScreenWidth() / 4,
       Toolkit.getScreenHeight() / 4,
       Toolkit.getScreenWidth() / 2,
       Toolkit.getScreenHeight() / 2,
       title);
 }
Example #2
-1
  private static int getWidth(String label, String title) {

    StringTokenizer tokenizer = new StringTokenizer(label, "\n");
    int result = 0;
    while (tokenizer.hasMoreElements()) {
      String token = tokenizer.nextToken();
      if (result < token.length()) {
        result = token.length();
      }
    }
    if (title.length() > result) {
      result = title.length();
    }
    // message nust fit on the schreen

    if (result > jcurses.system.Toolkit.getScreenWidth() - 3) {
      result = jcurses.system.Toolkit.getScreenWidth() - 3;
    }

    return result;
  }