Main Widgets

De GENIUS
Aller à la navigation Aller à la recherche

We find basic classes needed to build a scientific tool GUI … in particular entering real data with units  !!!

Here are some of such available widgets:

We do not explain how to use each item of this widget list. To do that, refer to the GENIUS javadoc. Moreover, we saw at the previous page how to manage a simple button. So, the principle is very simple :

  1. First, to declare the object, if possible as a global variable of the current class
  2. Then, to instantiate it, if possible inside the constructor of the current class
  3. Eventually to customize it (see later how to do do it)
  4. At last, use it, at list for display by "putting" it in the display() or generic() method

We can see below a very short example based on a GEntryReal

public class MyPanel extends GPanel {
 
  private GEntryReal myReal;
 
  public MyPanel () {
    myReal= new GEntryReal("This is a real:", 123.); // First value displayed will be 123.0
    myReal.setCurrentFormat(GRealField.Format.SCIENTIFIC);
  }
 
  public void display() {
    generic();
  }
 
  public void generic() throws GException {
    put(myReal);
  }
 
};

Return to the introduction ↑ Go to the next page →