Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default How to add different menuitems to child node

    Hi All,
    I have 2 Swing files 1 is Sync7000_SubChildConfTool.java (main file) and 2nd file is SerialPortSubChild.java (it has only 5 ComboBox fields and ok and cancel button). After running the main file SYNC7000 (root node) will display. If i right click on this root node i am getting 4 menu items (Add Serial Channel, Add Optical Channel, Add TCP/UDP Channel, Add Modem Channel) in popup. If i right click on that particular menu item then SerialPortSubChild file will open and after filling this frame i am getting Child node. It is fine up to now. But my problem is if i right click on particular Child node i want to display the menu items like Add Polling Group, Edit Channel, Delete Channel in the popup. Please anyone help me. Iam using NetBeans IDE 6.1.

    // Sync7000_SubChildConfTool.java

    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.JComponent;
    import javax.swing.JMenuItem;
    import javax.swing.JPopupMenu;
    import javax.swing.JTree;
    import javax.swing.event.PopupMenuEvent;
    import javax.swing.event.PopupMenuListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.DefaultTreeModel;
    import javax.swing.tree.TreeNode;
    import javax.swing.tree.TreePath;


    public class Sync7000_SubChildConfTool extends javax.swing.JFrame {

    /** Creates new form Sync7000_ConfigTool */
    public Sync7000_SubChildConfTool() {
    initComponents();
    rootNode = new DefaultMutableTreeNode("SYNC7000");
    treeModel = new DefaultTreeModel(rootNode);
    popup = new JPopupMenu();
    popup.setInvoker(jTree1);
    new PopupHandlerSubChild(jTree1);
    jTree1.setModel(treeModel);
    }

    public static void finalRecData(List list) {
    alist.add(list);
    System.out.println("**1");
    System.out.println(alist);
    System.out.println("**2");
    }

    private void displayDataInTable(String str) {
    // Iterator it = alist.iterator();
    // while (it.hasNext()) {
    // ll = (ArrayList) it.next();
    // }
    if (str.equals("SrChannel 0")) {
    List nl=(List)alist.get(0);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object[][]{
    {"COM Port", nl.get(0)},
    {"Parity", nl.get(1)},
    {"Data bits", nl.get(2)},
    {"Baud Rate", nl.get(3)},
    {"Stop bits", nl.get(4)},
    {"Name", nl.get(5)}
    },
    new String[]{
    "Name", "Value", "Type", "Property"
    }));
    }
    if (str.equals("OpChannel 1")) {
    List nl=(List)alist.get(1);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object[][]{
    {"COM Port", nl.get(0)},
    {"Parity", nl.get(1)},
    {"Data bits", nl.get(2)},
    {"Baud Rate", nl.get(3)},
    {"Stop bits", nl.get(4)},
    {"Name", nl.get(5)}
    },
    new String[]{
    "Name", "Value", "Type", "Property"
    }));
    }
    if (str.equals("TCPChannel 2")) {
    List nl=(List)alist.get(2);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object[][]{
    {"COM Port", nl.get(0)},
    {"Parity", nl.get(1)},
    {"Data bits", nl.get(2)},
    {"Baud Rate", nl.get(3)},
    {"Stop bits", nl.get(4)},
    {"Name", nl.get(5)}
    },
    new String[]{
    "Name", "Value", "Type", "Property"
    }));
    }
    if (str.equals("ModChannel 3")) {
    List nl=(List)alist.get(3);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object[][]{
    {"COM Port", nl.get(0)},
    {"Parity", nl.get(1)},
    {"Data bits", nl.get(2)},
    {"Baud Rate", nl.get(3)},
    {"Stop bits", nl.get(4)},
    {"Name", nl.get(5)}
    },
    new String[]{
    "Name", "Value", "Type", "Property"
    }));
    }
    }

    /** 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">
    private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel2 = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstan ts.DISPOSE_ON_CLOSE);

    org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBindi ng(org.jdesktop.beansbinding.AutoBinding.UpdateStr ategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("Sync7 000"), this, org.jdesktop.beansbinding.BeanProperty.create("tit le"));
    bindingGroup.addBinding(binding);

    jTree1.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
    public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
    jTree1ValueChanged(evt);
    }
    });
    jScrollPane1.setViewportView(jTree1);

    jTable1.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {

    },
    new String [] {

    }
    ));
    jScrollPane2.setViewportView(jTable1);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 466, Short.MAX_VALUE))
    );
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGroup(javax.swing.GroupLayout.Alignment.TRAILI NG, jPanel1Layout.createSequentialGroup()
    .addGroup(jPanel1Layout.createParallelGroup(javax. swing.GroupLayout.Alignment.TRAILING)
    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE)
    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE))
    .addContainerGap())
    );

    jTabbedPane1.addTab("tab1", jPanel1);

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 634, Short.MAX_VALUE)
    );
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(javax.swing.Grou pLayout.Alignment.LEADING)
    .addGap(0, 347, Short.MAX_VALUE)
    );

    jTabbedPane1.addTab("tab2", jPanel2);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addComponent(jTabbedPane1)
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 375, Short.MAX_VALUE)
    );

    bindingGroup.bind();

    pack();
    }// </editor-fold>

    private void jTree1ValueChanged(javax.swing.event.TreeSelection Event evt) {
    // TODO add your handling code here:
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();

    if (node == null) {
    return;
    }
    if (node != null) {
    displayDataInTable(node.toString());
    }
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new Sync7000_SubChildConfTool().setVisible(true);
    }
    });
    }

    // Variables declaration - do not modify
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTree jTree1;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration
    DefaultMutableTreeNode rootNode;
    DefaultTreeModel treeModel;
    JPopupMenu popup;
    private static java.util.ArrayList alist = new ArrayList();
    }
    class PopupHandlerSubChild implements ActionListener, PopupMenuListener {

    JTree tree;
    JPopupMenu popup;
    JMenuItem item;
    boolean overRoot = false;
    Point loc;
    List myList = new ArrayList();

    public PopupHandlerSubChild(JTree tree) {

    this.tree = tree;
    popup = new JPopupMenu();
    popup.setInvoker(tree);

    item = new JMenuItem("Add Serial Channel");
    item.addActionListener(this);
    item.setActionCommand("insert");
    popup.add(item);
    item = new JMenuItem("Add Optical Channel");
    item.addActionListener(this);
    item.setActionCommand("oinsert");
    popup.add(item);
    item = new JMenuItem("Add TCP/UDP Channel");
    item.addActionListener(this);
    item.setActionCommand("tinsert");
    popup.add(item);
    item = new JMenuItem("Add Modem Channel");
    item.addActionListener(this);
    item.setActionCommand("minsert");
    popup.add(item);

    popup.setOpaque(true);
    popup.setLightWeightPopupEnabled(true);

    tree.addMouseListener(ma);
    popup.addPopupMenuListener(this);
    }

    public JPopupMenu getPopup() {
    return popup;
    }

    public void actionPerformed(ActionEvent e) {

    //DefaultMutableTreeNode dmtn, node;

    TreePath path = tree.getSelectionPath();
    //dmtn = (DefaultMutableTreeNode) path.getLastPathComponent();
    if (e.getActionCommand().equals("insert")) {
    SerialPortSubChild sp = new SerialPortSubChild();
    sp.setVisible(true);

    DefaultMutableTreeNode parent =
    (DefaultMutableTreeNode) path.getLastPathComponent();
    int count = parent.getChildCount();
    DefaultMutableTreeNode child =
    new DefaultMutableTreeNode("SrChannel " + count);
    DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
    model.insertNodeInto(child, parent, count);
    }
    if (e.getActionCommand().equals("oinsert")) {
    SerialPortSubChild sp = new SerialPortSubChild();
    sp.setVisible(true);

    DefaultMutableTreeNode parent =
    (DefaultMutableTreeNode) path.getLastPathComponent();
    int count = parent.getChildCount();
    DefaultMutableTreeNode child =
    new DefaultMutableTreeNode("OpChannel " + count);
    DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
    model.insertNodeInto(child, parent, count);
    }
    if (e.getActionCommand().equals("tinsert")) {
    SerialPortSubChild sp = new SerialPortSubChild();
    sp.setVisible(true);

    DefaultMutableTreeNode parent =
    (DefaultMutableTreeNode) path.getLastPathComponent();
    int count = parent.getChildCount();
    DefaultMutableTreeNode child =
    new DefaultMutableTreeNode("TCPChannel " + count);
    DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
    model.insertNodeInto(child, parent, count);
    }
    if (e.getActionCommand().equals("minsert")) {
    SerialPortSubChild sp = new SerialPortSubChild();
    sp.setVisible(true);

    DefaultMutableTreeNode parent =
    (DefaultMutableTreeNode) path.getLastPathComponent();
    int count = parent.getChildCount();
    DefaultMutableTreeNode child =
    new DefaultMutableTreeNode("ModChannel " + count);
    DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
    model.insertNodeInto(child, parent, count);
    }
    }
    private MouseListener ma = new MouseAdapter() {

    private void checkForPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
    loc = e.getPoint();
    TreePath path = tree.getPathForLocation(loc.x, loc.y);
    if (path == null) {
    e.consume();
    return;
    }
    TreeNode root = (TreeNode) tree.getModel().getRoot();
    ;
    overRoot = path.getLastPathComponent() == root;
    popup.show(tree, loc.x, loc.y);
    }
    }

    public void mousePressed(MouseEvent e) {
    checkForPopup(e);
    }

    public void mouseReleased(MouseEvent e) {
    //checkForPopup(e);
    int row = tree.getRowForLocation(e.getX(), e.getY());
    if (row == -1) {
    return;
    }
    tree.setSelectionRow(row);
    if (e.isPopupTrigger()) {
    popup.show((JComponent) e.getSource(),
    e.getX(), e.getY());
    }
    }

    public void mouseClicked(MouseEvent e) {
    checkForPopup(e);
    }
    };

    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
    item.setVisible(!overRoot);
    }

    public void popupMenuCanceled(PopupMenuEvent e) {
    }

    public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
    }
    }



    ***************************************


    2) //SerialPortSubChild.java

    public class SerialPortSubChild extends javax.swing.JFrame {

    /** Creates new form SerialPort */
    public SerialPortSubChild() {
    initComponents();
    }

    /** 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">
    private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jComboBox1 = new javax.swing.JComboBox();
    jComboBox2 = new javax.swing.JComboBox();
    jComboBox3 = new javax.swing.JComboBox();
    jComboBox4 = new javax.swing.JComboBox();
    jComboBox5 = new javax.swing.JComboBox();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();

    setDefaultCloseOperation(javax.swing.WindowConstan ts.EXIT_ON_CLOSE);

    org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBindi ng(org.jdesktop.beansbinding.AutoBinding.UpdateStr ategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("Seria l Port"), this, org.jdesktop.beansbinding.BeanProperty.create("tit le"));
    bindingGroup.addBinding(binding);

    jLabel1.setText("COM Port");

    jLabel2.setText("Parity");

    jLabel3.setText("Data bits");

    jLabel4.setText("Baud rate");

    jLabel5.setText("Stop bits");

    jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "COM 1", "COM 2", "COM 3", "COM 4" }));

    jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Even", "Odd" }));

    jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "8", "9" }));

    jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "110", "300", "1200", "4800", "9600", "19200", "38400", "57600", "115200", "230400", "460800", "921600" }));

    jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1", "2" }));

    jButton1.setText("OK");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    }
    });

    jButton2.setText("Cancel");
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    }
    });

    jLabel6.setText("Name");

    jTextField1.setEditable(false);
    jTextField1.setText("Channel");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(48, 48, 48)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING)
    .addComponent(jLabel1)
    .addComponent(jLabel2)
    .addComponent(jLabel3)
    .addComponent(jLabel4)
    .addComponent(jLabel5)
    .addComponent(jLabel6))
    .addGap(70, 70, 70)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.LEADING)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
    .addGroup(layout.createSequentialGroup()
    .addGap(69, 69, 69)
    .addComponent(jButton1)
    .addGap(27, 27, 27)
    .addComponent(jButton2)))
    .addContainerGap(174, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout .Alignment.LEADING)
    .addGroup(layout.createSequentialGroup()
    .addGap(28, 28, 28)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.BASELINE)
    .addComponent(jLabel1)
    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(8, 8, 8)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.TRAILING)
    .addComponent(jLabel2)
    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.TRAILING)
    .addComponent(jLabel3)
    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.TRAILING)
    .addComponent(jLabel4)
    .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addPreferredGap(javax.swing.LayoutStyle.Component Placement.RELATED)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.TRAILING)
    .addComponent(jLabel5)
    .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(18, 18, 18)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.BASELINE)
    .addComponent(jLabel6)
    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
    .addGap(38, 38, 38)
    .addGroup(layout.createParallelGroup(javax.swing.G roupLayout.Alignment.BASELINE)
    .addComponent(jButton1)
    .addComponent(jButton2))
    .addContainerGap(47, Short.MAX_VALUE))
    );

    bindingGroup.bind();

    pack();
    }// </editor-fold>

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    listMethod();
    closeApplication();
    }
    public void listMethod() {
    alist = new java.util.ArrayList();
    alist.clear();
    Object[] obj1 = jComboBox1.getSelectedObjects();
    for (Object s : obj1) {
    alist.add(s);
    }
    Object[] obj2 = jComboBox2.getSelectedObjects();
    for (Object s : obj2) {
    alist.add(s);
    }
    Object[] obj3 = jComboBox3.getSelectedObjects();
    for (Object s : obj3) {
    alist.add(s);
    }
    Object[] obj4 = jComboBox4.getSelectedObjects();
    for (Object s : obj4) {
    alist.add(s);
    }
    Object[] obj5 = jComboBox5.getSelectedObjects();
    for (Object s : obj5) {
    alist.add(s);

    String ss = jTextField1.getText();
    alist.add(ss);
    }
    Sync7000_SubChildConfTool.finalRecData(alist);
    }

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    closeApplication();
    }
    private void closeApplication() {
    dispose();
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new SerialPortSubChild().setVisible(true);
    }
    });
    }

    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JTextField jTextField1;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration
    private java.util.ArrayList alist;
    }

  2. #2
    Michael Dunn is offline Member
    Join Date
    Jul 2008
    Posts
    62
    Rep Power
    0

    Default

    another
    "I want an answer, and I want it now, so I'll post it everywhere"

    link to cross-post is at coderanch, swing forum

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

Similar Threads

  1. how to get the child class in inheritance?
    By java_fun2007 in forum New To Java
    Replies: 7
    Last Post: 09-29-2010, 10:35 AM
  2. How to get value of specific child node
    By sito42 in forum New To Java
    Replies: 1
    Last Post: 07-13-2009, 01:00 PM
  3. Cannot add or update a child row....
    By Pierced1 in forum JDBC
    Replies: 2
    Last Post: 06-29-2009, 03:32 AM
  4. Replies: 3
    Last Post: 11-21-2008, 08:43 AM
  5. Child Labor
    By freddieMaize in forum Forum Lobby
    Replies: 1
    Last Post: 11-16-2008, 09:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •