/*
* Copyright (c) 2011, StripBandunk and/or its affiliates. All rights reserved.
*
* http://stripbandunk.com/
*
* STRIPBANDUNK PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/*
* Form.java
*
* Created on Oct 12, 2011, 1:10:00 PM
*/
package stripbandunk.tutorial.jtreehibernate;
import stripbandunk.tutorial.jtreehibernate.helper.CategoryTreeCreator;
import stripbandunk.tutorial.jtreehibernate.service.CategoryService;
import stripbandunk.tutorial.jtreehibernate.service.CategoryServiceImpl;
/**
*
* @author echo
*/
public class Form extends javax.swing.JFrame {
private static final long serialVersionUID = 1L;
/** Creates new form Form */
public Form() {
initComponents();
CategoryService service = new CategoryServiceImpl();
CategoryTreeCreator creator = new CategoryTreeCreator("Category");
creator.addAll(service.getAll());
jTreeCategory.setModel(creator.getModel());
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTreeCategory = new javax.swing.JTree();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jScrollPane1.setName("jScrollPane1"); // NOI18N
jTreeCategory.setName("jTreeCategory"); // NOI18N
jScrollPane1.setViewportView(jTreeCategory);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTree jTreeCategory;
// End of variables declaration//GEN-END:variables
}