Example usage for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode

List of usage examples for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode

Introduction

In this page you can find the example usage for javax.swing.tree DefaultMutableTreeNode DefaultMutableTreeNode.

Prototype

public DefaultMutableTreeNode() 

Source Link

Document

Creates a tree node that has no parent and no children, but which allows children.

Usage

From source file:op.care.med.structure.PnlMed.java

private void txtSucheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSucheActionPerformed
    //        treeMed.setCellRenderer(new DefaultTreeCellRenderer());
    treeMed.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
    //        treeMed.setVisible(false);
    if (txtSuche.getText().isEmpty()) {
        lstPraep.setModel(new DefaultListModel());
    } else {/*  w w  w.  ja v  a  2  s  . c om*/
        EntityManager em = OPDE.createEM();
        Query query = em
                .createQuery("SELECT m FROM MedProducts m WHERE m.text LIKE :bezeichnung ORDER BY m.text");
        query.setParameter("bezeichnung", "%" + txtSuche.getText() + "%");
        lstPraep.setModel(SYSTools.list2dlm(query.getResultList()));
        em.close();
    }
}