Example usage for java.awt Label hide

List of usage examples for java.awt Label hide

Introduction

In this page you can find the example usage for java.awt Label hide.

Prototype

@Deprecated
public void hide() 

Source Link

Usage

From source file:Presentation.MainWindow.java

/** Update des valeurs de temprature et d'humidit en temps rel */
public void updateLiveValues(float temperature, float humidite, boolean condense) {

    Component[] labels = this.tPanel.getComponents();

    if (labels.length > 0) {

        if (labels[0] instanceof Label) {
            Label nLabelTemp = (Label) labels[0];
            nLabelTemp.setText("Temprature du frigo : " + temperature + " C");
        }//from   w  w  w.  j  a va2s .co m

        if (labels[1] instanceof Label) {
            Label nLabelTemp = (Label) labels[1];
            nLabelTemp.setText(
                    "Temprature extrieure : " + Singleton.getInstance().getMock().getOutdoorTemp() + " C");
        }

        if (labels[2] instanceof Label) {
            Label nLabelHumid = (Label) labels[2];
            nLabelHumid.setText("Humidit  l'intrieur du frigo : " + humidite + " %");
        }

        if (labels[3] instanceof Label) {
            Label nLabelCondense = (Label) labels[3];
            if (!condense)
                nLabelCondense.hide();
            else
                nLabelCondense.show();
        }
        show();
    } else
        showLiveValues(temperature, humidite, condense);
}

From source file:Presentation.MainWindow.java

/** Ajout  la fentre des valeurs de temprature et d'humidit en temps rel */
public void showLiveValues(float temperature, float humidite, boolean condense) {
    Panel panel = new Panel();
    Label labelTemp = new Label("Temprature du frigo : " + temperature + " C");
    Label labelOutdoorTemp = new Label(
            "Temprature extrieure : " + Singleton.getInstance().getMock().getOutdoorTemp() + " C");
    Label labelHumid = new Label("Humidit  l'intrieur du frigo : " + humidite + " %");
    Label condensation = new Label("Alerte de condensation");

    condensation.setForeground(Color.red);

    //  addCondensation();
    panel.setLayout(new FlowLayout());
    panel.add(labelTemp);//from  w  ww . ja  v  a  2s  .  c  o  m
    panel.add(labelOutdoorTemp);
    panel.add(labelHumid);
    if (condense)
        panel.add(condensation);
    else {
        panel.add(condensation);
        condensation.hide();
    }
    //  panel.add(cLabel);

    this.tPanel = panel;
    mPanel.add(panel);

    show();
}