Example usage for javax.swing JToggleButton doClick

List of usage examples for javax.swing JToggleButton doClick

Introduction

In this page you can find the example usage for javax.swing JToggleButton doClick.

Prototype

public void doClick() 

Source Link

Document

Programmatically perform a "click".

Usage

From source file:com.maxl.java.amikodesk.AMiKoDesk.java

static void startAppWithTitle(JToggleButton but_title) {
    m_query_str = CML_OPT_TITLE;//  ww w.  ja  v a  2 s . co  m
    med_search = m_sqldb.searchTitle(m_query_str);
    // Check first if search delivers any result
    if (med_search.size() > 0) {
        if (CML_OPT_TYPE.equals("full"))
            but_title.doClick();
        else if (CML_OPT_TYPE.equals("light")) {
            m_query_type = 0;
            med_id.clear();
            for (int i = 0; i < med_search.size(); ++i) {
                Medication ms = med_search.get(i);
                med_id.add(ms.getId());
            }
        }
        med_index = 0;
        m_web_panel.updateText();
    }
}

From source file:com.maxl.java.amikodesk.AMiKoDesk.java

static void startAppWithRegnr(JToggleButton but_regnr) {
    // Simple check, should be improved...
    if (CML_OPT_REGNR.length() == 5) {
        m_query_str = CML_OPT_REGNR;// w  w  w.  java2  s.  c  om
        med_search = m_sqldb.searchRegNr(m_query_str);
        // Check first if search delivers any result
        if (med_search.size() > 0) {
            if (CML_OPT_TYPE.equals("full"))
                but_regnr.doClick();
            else if (CML_OPT_TYPE.equals("light")) {
                m_query_type = 3;
                med_id.clear();
                for (int i = 0; i < med_search.size(); ++i) {
                    Medication ms = med_search.get(i);
                    med_id.add(ms.getId());
                }
            }
            med_index = 0;
            m_web_panel.updateText();
        }
    } else {
        System.out.println("> Error: Wrong registration number");
    }
}

From source file:com.maxl.java.amikodesk.AMiKoDesk.java

static void startAppWithEancode(JToggleButton but_regnr) {
    // Check if delivered eancode is "kosher"
    if (CML_OPT_EANCODE.length() == 13 && CML_OPT_EANCODE.indexOf("7680") == 0) {
        // Extract 5-digit registration number
        m_query_str = CML_OPT_EANCODE.substring(4, 9);
        med_search = m_sqldb.searchRegNr(m_query_str);
        // Check first if search delivers any result
        if (med_search.size() > 0) {
            if (CML_OPT_TYPE.equals("full"))
                but_regnr.doClick();
            else if (CML_OPT_TYPE.equals("light")) {
                m_query_type = 3;/* ww w  .  j av  a 2s . c  om*/
                med_id.clear();
                for (int i = 0; i < med_search.size(); ++i) {
                    Medication ms = med_search.get(i);
                    med_id.add(ms.getId());
                }
            }
            med_index = 0;
            m_web_panel.updateText();
        }
    } else {
        System.out.println("> Error: Wrong EAN code");
    }
}