Class FOptionPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class FOptionPane extends JDialog
Personalised JDialog.
Used to get a save name, get a creature id, get a food quantity etc.
Author:
Hydrolien
See Also:
  • Field Details

    • textField

      private FTextField textField
    • comboBox

      private FComboBox<String> comboBox
    • slider

      private FSlider slider
    • intField

      private FIntField intField
    • returnValue

      private int returnValue
    • bOk

      private FButton bOk
    • bNotOk

      private FButton bNotOk
    • greyOthers

      private boolean greyOthers
  • Constructor Details

    • FOptionPane

      public FOptionPane(Frame owner)
      Main constructor.
      Parameters:
      owner - Frame that own this
    • FOptionPane

      public FOptionPane()
      Constructor that use main frame as owner.
  • Method Details

    • build

      public void build()
      After have use all setter set visible.
    • getReturnValue

      public int getReturnValue()
    • setReturnValue

      public void setReturnValue(int returnValue)
    • isGreyOthers

      public boolean isGreyOthers()
    • setGreyOthers

      public void setGreyOthers(boolean greyOthers)
    • addOKButton

      public void addOKButton()
      Add an OK Button.
      It will set return value to 1
    • addNotOKButton

      public void addNotOKButton()
      Add a not OK Button.
      It will set return value to 0
    • onNotOkButtonPress

      public void onNotOkButtonPress()
      Action of a not OK Button.
    • disposeFOptionPane

      public void disposeFOptionPane()
      Close the FOptionPane.
    • addText

      public void addText(String content)
      Add an non-editable text field.
      Parameters:
      content - default content
    • addField

      public void addField(String content)
      Add an editable text field.
      Parameters:
      content - default content
    • addIntField

      public void addIntField(int min, int max, int value)
      Add an editable int field.
      Parameters:
      min - the min value
      max - the max value
      value - default value
    • addComboBox

      public void addComboBox(String[] content)
      Add a combo box.
      Parameters:
      content - content of the combo box
    • addSlider

      public void addSlider(int min, int max, int value)
      Add a slider.
      Parameters:
      min - the min value
      max - the max value
      value - the curent value
    • addSliderAndIntField

      public void addSliderAndIntField(int min, int max, int value)
      Add a slider & an int field.
      The 2 are connected.
      Parameters:
      min - the min value
      max - the max value
      value - the curent value
    • getContent

      public String getContent()
      Return the content of the text field.
    • alerte

      public static void alerte(String popUpMessage)
      print an alerte box.
      Parameters:
      popUpMessage - message of the popUp
    • question

      public static String question(String popUpMessage)
      Print a question box.
      Parameters:
      popUpMessage - message of the popUp
      Returns:
      user answer
    • questionYN

      public static boolean questionYN(String popUpMessage, boolean important, fr.formiko.usual.CheckFunction cf)
      Print a yes/no question box.
      Parameters:
      popUpMessage - message of the popUp
      important - some gui action will be done if true
      cf - a checkBox item that launch a function if checked
      Returns:
      answer.
    • questionYN

      public static boolean questionYN(String popUpMessage, boolean important)
      Print a yes/no question box.
      Parameters:
      popUpMessage - message of the popUp
      important - some gui action will be done if true
      Returns:
      answer.
    • questionYN

      public static boolean questionYN(String popUpMessage)
      Print a yes/no question box.
      Parameters:
      popUpMessage - message of the popUp
      Returns:
      answer.
    • showConfirmDialog

      public static int showConfirmDialog(Frame parentComponent, String message, boolean important, fr.formiko.usual.CheckFunction cf)
      Print a yes/no question box.
      Parameters:
      parentComponent - the owner of this
      message - message of the popUp
      cf - a checkBox item that launch a function if checked
      Returns:
      answer.
    • showMessageDialog

      public static void showMessageDialog(Frame parentComponent, Component content, String message)
      Print a message.
      Parameters:
      parentComponent - the owner of this
      content - content of this
      message - message of the popUp