Class DialogUtilities

java.lang.Object
org.jlab.io.ui.DialogUtilities

public class DialogUtilities extends Object
  • Field Details

    • OK_RESPONSE

      public static final int OK_RESPONSE
      Dialog "Reason" constant
      See Also:
    • CANCEL_RESPONSE

      public static final int CANCEL_RESPONSE
      Dialog "Reason" constant
      See Also:
    • outputdata

      protected String outputdata
      Current answer string
    • APPLY_RESPONSE

      public static final int APPLY_RESPONSE
      Dialog "Reason" constant
      See Also:
    • DONE_RESPONSE

      public static final int DONE_RESPONSE
      Dialog "Reason" constant
      See Also:
    • YES_RESPONSE

      public static final int YES_RESPONSE
      Dialog "Reason" constant
      See Also:
    • NO_RESPONSE

      public static final int NO_RESPONSE
      Dialog "Reason" constant
      See Also:
  • Constructor Details

    • DialogUtilities

      public DialogUtilities()
  • Method Details

    • centerDialog

      public static void centerDialog(Component component)
      Center a dialog
      Parameters:
      component - the component to center
    • padString

      public String padString(Component c, String inp, String tstr)
      Convenience routine for padding a string using the default font.
      Parameters:
      inp - The string to be padded.
      tstr - The test string-- try to return a string the same length
    • paddedPanel

      public static JPanel paddedPanel(int hpad, int vpad, Component component)
      Create a nice padded panel.
      Parameters:
      hpad - the pixel pad on the left and right
      vpad - the pixel pad on the top and bottom
      component - the main component placed in the center.
      Returns:
      the padded panel
    • yesNoDialog

      public static int yesNoDialog(String prompt, String... options)
      Create a dialog with a prompt and a set of options
      Parameters:
      prompt -
      options -
      Returns:
      a result indicating yes or no.