Example usage for javax.swing DefaultListModel addElement

List of usage examples for javax.swing DefaultListModel addElement

Introduction

In this page you can find the example usage for javax.swing DefaultListModel addElement.

Prototype

public void addElement(E element) 

Source Link

Document

Adds the specified component to the end of this list.

Usage

From source file:edu.ksu.cs.a4vm.bse.reporter.Reporter.java

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
    jPanel3.setVisible(true);//from w w w.ja v  a2  s  .  com
    DefaultListModel dlm = new DefaultListModel();
    for (int y = 0; y < Bulls.length; y++) {
        dlm.addElement(Bulls[y]);
    }
    jList3.setModel(dlm);
    jPanel2.setVisible(false);
    pack();
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.DataImportDialog.java

/**
 * Goes through and checks the import data for potential errors (where the data being import
 * violates size constraints when being imported into the data base - ie. column header length (64)
 * or field value length (255)/*from w  ww.j a v  a 2 s  .  c om*/
 * @param headers - the column headers
 * @param data - the table data
 * @return
 * JList - all list of errors
 */
private JList genListOfErrorWhereTableDataDefiesSizeConstraints(String[] headers, String[][] data) {
    DefaultListModel listModel = new DefaultListModel();
    JList listOfImportDataErrors = new JList();
    for (int i = 0; i < headers.length; i++) {
        if (!isStringShorterThan(WorkbenchTemplateMappingItem.getImportedColNameMaxLength(), headers[i])) {
            String msg = "Column at index=" + i
                    + " is too long to be inserted into the database.  It will be truncated.\n"
                    + "Current Value:\n" + headers[i] + "\nTruncated Value:\n"
                    + headers[i].substring(0, WorkbenchTemplateMappingItem.getImportedColNameMaxLength() - 1);
            log.warn(msg);
            listModel.addElement(msg);
        }
    }
    for (int i = 0; i < data.length; i++) {
        for (int j = 0; j < data[i].length; j++) {
            //WorkbenchDataItem.class.getDeclaredMethod("getCellData", null).getDeclaredAnnotations();
            String str = data[i][j];
            if (!isStringShorterThan(WorkbenchDataItem.getMaxWBCellLength(), str)) {
                String msg = "The value in cell Row=" + i + ", Column=" + headers[j]
                        + " is too long to be inserted into the database.  It will be truncated.\n"
                        + "Current Value:\n" + str + "\nTruncated Value:\n"
                        + str.substring(0, WorkbenchDataItem.getMaxWBCellLength() - 1);
                log.warn(msg);
                listModel.addElement(msg);
            }
        }
    }
    listOfImportDataErrors.setModel(listModel);
    return listOfImportDataErrors;
}

From source file:gtu._work.etc.EnglishTester.java

/**
 * /*from  w  ww  .  j a v a 2  s .  c  o  m*/
 */
void reloadFileList() {
    DefaultListModel fileListModel = new DefaultListModel();
    File targetDir = PropertiesUtil.getJarCurrentPath(EnglishTester.class); // FIXME
    //        targetDir = new File("D:/my_tool/english"); // FIXME
    File[] list = targetDir.listFiles(new FilenameFilter() {
        @Override
        public boolean accept(File dir, String name) {
            return name.matches(".*\\.properties");
        }
    });
    Arrays.sort(list, new Comparator<File>() {
        @Override
        public int compare(File o1, File o2) {
            if (o1.lastModified() < o2.lastModified()) {
                return -1;
            }
            if (o1.lastModified() > o2.lastModified()) {
                return 1;
            }
            return 0;
        }
    });
    for (File f : list) {
        fileListModel.addElement(f);
    }
    fileList.setModel(fileListModel);
}

From source file:edu.ku.brc.af.tasks.subpane.formeditor.ViewSetSelectorPanel.java

protected void viewSetSelected() {
    selectedViewSet = null;/* ww  w. j  a va 2s  .c o  m*/
    selectedView = null;
    selectedViewDef = null;
    selectedAltView = null;

    ((DefaultTreeModel) tree.getModel()).setRoot(null);

    DefaultListModel model;

    model = (DefaultListModel) altViewsList.getModel();
    model.clear();

    model = (DefaultListModel) viewDefsList.getModel();
    model.clear();

    model = (DefaultListModel) viewsList.getModel();
    model.clear();

    int inx = viewSetsList.getSelectedIndex();
    if (inx > -1) {
        selectedViewSet = (ViewSet) viewSetVector.get(inx);

        viewControlPanel.getAddBtn().setEnabled(true);
        viewDefControlPanel.getAddBtn().setEnabled(true);

        Vector<String> names = new Vector<String>(selectedViewSet.getViews().keySet());
        Collections.sort(names);
        for (String viewName : names) {
            model.addElement(viewName);
        }

        model = (DefaultListModel) viewDefsList.getModel();
        names.clear();
        names.addAll(selectedViewSet.getViewDefs().keySet());
        Collections.sort(names);
        for (String viewDefName : names) {
            model.addElement(viewDefName);
        }

    } else {
        viewControlPanel.getAddBtn().setEnabled(false);
        viewDefControlPanel.getAddBtn().setEnabled(false);
    }
}

From source file:edu.ksu.cs.a4vm.bse.reporter.Reporter.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    jTextField1.setText("");
    JFileChooser choose = new JFileChooser();
    choose.showOpenDialog(null);//from w  ww. jav a  2  s .c  o m
    f = choose.getSelectedFile();
    String path = f.getAbsolutePath();
    jTextField1.setText(path);
    jPanel2.setVisible(true);

    header = new String[120];
    for (int x = 0; x < 120; x++) {
        header[x] = "";
    }
    String line = "";
    BufferedReader br2 = null;
    try {
        br2 = new BufferedReader(new FileReader(f));
    } catch (FileNotFoundException ex) {
        Logger.getLogger(Reporter.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {

        while ((line = br2.readLine()) != null) {

            // use comma as separator
            String Bull[] = line.split(",");
            //  System.out.println(Bull.length);
            if (number_of_rows == 0) {
                for (int i = 0; i < Bull.length; i++) {
                    header[i] = Bull[i];
                }
            }

            number_of_rows++;

        }

    } catch (IOException ex) {
        Logger.getLogger(Reporter.class.getName()).log(Level.SEVERE, null, ex);
    }
    Bulls = new String[number_of_rows - 1];
    for (int x = 0; x < Bulls.length; x++) {
        Bulls[x] = "";
    }

    BufferedReader br3 = null;
    try {
        br3 = new BufferedReader(new FileReader(f));
    } catch (FileNotFoundException ex) {
        Logger.getLogger(Reporter.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {
        int k = 0;
        while ((line = br3.readLine()) != null) {

            // use comma as separator
            String Bull[] = line.split(",");
            //  System.out.println(Bull.length);
            if (k != 0) {
                if (!Bull[2].equals("")) {
                    Bulls[k - 1] += Bull[2] + ("(Brand) ");
                }
                if (!Bull[6].equals("")) {
                    Bulls[k - 1] += Bull[6] + ("(RFID) ");
                }
                if (!Bull[7].equals("")) {
                    Bulls[k - 1] += Bull[7] + ("(Tag) ");
                }
                if (!Bull[8].equals("")) {
                    Bulls[k - 1] += Bull[8] + ("(Tattoo) ");
                }
                if (!Bull[9].equals("")) {
                    Bulls[k - 1] += Bull[9] + ("(Other) ");
                }
                Bulls[k - 1] += ":" + k;

            }
            k++;
        }

    } catch (IOException ex) {
        Logger.getLogger(Reporter.class.getName()).log(Level.SEVERE, null, ex);
    }

    for (int y = 0; y < Bulls.length; y++) {
        System.out.print(Bulls[y]);
    }

    DefaultListModel dlm = new DefaultListModel();
    for (int y = 0; y < header.length; y++) {
        if (header[y].equals(""))
            break;
        if (y != 2 && y != 7 && y != 8 && y != 6 && y != 9 && y != 34) {
            if (y < 55 || y > 75) {
                dlm.addElement(header[y] + ": " + y);
            }
        }

    }
    jList1.setModel(dlm);
    jPanel1.setVisible(false);
    pack();
}

From source file:com.farouk.projectapp.FirstGUI.java

/**
 * 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./*from   w w  w  . j  a v a  2  s.  c o  m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel5 = new javax.swing.JPanel();
    jPanel6 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    DefaultTableModel a = new DefaultTableModel();
    jTable2 = new javax.swing.JTable() {
        public boolean isCellEditable(int d, int c) {
            return false;
        }

        @Override
        public Component prepareRenderer(TableCellRenderer renderer, int row, int col) {
            Component comp = super.prepareRenderer(renderer, row, col);
            String value = getModel().getValueAt(row, 0).toString();
            int a = SQLConnect.ifReported(userID, value);
            if (a == 1) {
                comp.setBackground(Color.red);
            } else {
                comp.setBackground(Color.white);
                comp.setForeground(Color.black);
            }

            return comp;
        }
    };
    jButton5 = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jSeparator2 = new javax.swing.JSeparator();
    jButton10 = new javax.swing.JButton();
    jLabel10 = new javax.swing.JLabel();
    jPanel15 = new javax.swing.JPanel();
    jPanel16 = new javax.swing.JPanel();
    jTextField6 = new javax.swing.JTextField();
    jTextField7 = new javax.swing.JTextField();
    jLabel14 = new javax.swing.JLabel();
    jButton13 = new javax.swing.JButton();
    jButton14 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jPanel10 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jEditorPane1 = new javax.swing.JEditorPane();
    jButton15 = new javax.swing.JButton();
    jButton19 = new javax.swing.JButton();
    jTextField4 = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jTextField1 = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane5 = new javax.swing.JScrollPane();
    jTable3 = new javax.swing.JTable() {
        public boolean isCellEditable(int d, int c) {
            return false;
        }
    };
    jButton6 = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    jPanel8 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    DefaultListModel modelCompaniesName = new DefaultListModel();
    try {
        for (String p : SQLConnect.getAllCompaniesNames()) {
            modelCompaniesName.addElement(p);
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    jList1 = new javax.swing.JList();
    jLabel3 = new javax.swing.JLabel();
    jButton4 = new javax.swing.JButton();
    jButton9 = new javax.swing.JButton();
    jLabel9 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jButton8 = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    jTextField2 = new javax.swing.JTextField();
    jPasswordField1 = new javax.swing.JPasswordField();
    jButton11 = new javax.swing.JButton();
    jButton12 = new javax.swing.JButton();
    jPanel9 = new javax.swing.JPanel();
    jLabel11 = new javax.swing.JLabel();
    jButton17 = new javax.swing.JButton();
    jLabel12 = new javax.swing.JLabel();
    jButton18 = new javax.swing.JButton();
    jTextField3 = new javax.swing.JTextField();
    jLabel15 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    jMenuItem1 = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    jMenuItem2 = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jTabbedPane1.setToolTipText("");
    jTabbedPane1.setMinimumSize(new java.awt.Dimension(150, 200));
    jTabbedPane1.setPreferredSize(new java.awt.Dimension(200, 200));

    jScrollPane1.setViewportView(jTable2);
    jTable2.setModel(a);
    try {
        UpdatejTable2();
    } catch (Exception e) {
        e.printStackTrace();
    }
    jTable2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jTable2MouseClicked(evt);
        }
    });
    jTable2.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            jTable2KeyReleased(evt);
        }
    });
    jScrollPane1.setViewportView(jTable2);

    jButton5.setText("Refresh My Portfolio");
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });

    jLabel4.setText("   Last Refreshed : ");

    jButton10.setText("Refresh Company");
    jButton10.setVisible(false);
    jButton10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton10ActionPerformed(evt);
        }
    });

    jLabel10.setText("Total is : " + String.valueOf(total.doubleValue()) + "");

    jTextField6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField6ActionPerformed(evt);
        }
    });
    jTextField6.setVisible(false);

    jTextField7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField7ActionPerformed(evt);
        }
    });

    jLabel14.setText("N of Actions");

    javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
    jPanel16.setLayout(jPanel16Layout);
    jPanel16Layout.setHorizontalGroup(jPanel16Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                    .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel16Layout.createSequentialGroup()
                                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 42,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(34, 34, 34).addComponent(jTextField6,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel14))
                    .addGap(0, 3, Short.MAX_VALUE)));
    jPanel16Layout.setVerticalGroup(jPanel16Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                    .addComponent(jLabel14)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(13, 13, 13)));

    jButton13.setText("Buy");
    jButton13.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton13ActionPerformed(evt);
        }
    });

    jButton14.setText("Sell");
    jButton14.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton14ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
    jPanel15.setLayout(jPanel15Layout);
    jPanel15Layout
            .setHorizontalGroup(
                    jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jButton13)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton14).addGap(166, 166, 166))
                            .addGroup(jPanel15Layout.createSequentialGroup()
                                    .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel15Layout
            .setVerticalGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, 58,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel15Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jButton14).addComponent(jButton13))));

    jButton7.setText("Get News !");
    jButton7.setVisible(false);
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });

    jButton3.setText("Report");
    jButton3.setVisible(false);
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });

    jPanel10.setVisible(false);

    jScrollPane2.setViewportView(jEditorPane1);

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                    jPanel10Layout.createSequentialGroup().addGap(39, 39, 39).addComponent(jScrollPane2,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)));
    jPanel10Layout.setVerticalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel10Layout
                    .createSequentialGroup().addContainerGap().addComponent(jScrollPane2).addContainerGap()));

    jButton15.setText("Automate");
    jButton15.setVisible(false);
    jButton15.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton15ActionPerformed(evt);
        }
    });

    jButton19.setText("Alert");
    jButton19.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton19ActionPerformed(evt);
        }
    });

    jTextField4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField4ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addGroup(jPanel6Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)
                    .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, 131,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jButton19, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton15, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel6Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jButton3).addComponent(jTextField4,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 68,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addGroup(jPanel6Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel6Layout.createSequentialGroup()
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel6Layout
                                                    .createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                            jPanel6Layout.createSequentialGroup()
                                                                    .addGroup(jPanel6Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.TRAILING)
                                                                            .addComponent(jLabel10)
                                                                            .addComponent(jButton10))
                                                                    .addPreferredGap(
                                                                            javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                                    .addGroup(jPanel6Layout.createParallelGroup(
                                                                            javax.swing.GroupLayout.Alignment.LEADING)
                                                                            .addComponent(jButton5)
                                                                            .addComponent(jLabel4)))
                                                    .addComponent(jLabel5,
                                                            javax.swing.GroupLayout.Alignment.TRAILING,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 157,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(jPanel6Layout.createSequentialGroup().addGap(70, 70, 70)
                                            .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    419, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(0, 0, Short.MAX_VALUE)))))
                    .addContainerGap()));

    jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { jButton3, jTextField4 });

    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 249,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel6Layout.createSequentialGroup().addComponent(jButton7)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel6Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jButton15).addComponent(jButton3))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel6Layout
                                            .createParallelGroup(
                                                    javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(jButton19)
                                            .addGroup(jPanel6Layout.createSequentialGroup().addGap(1, 1, 1)
                                                    .addComponent(jTextField4)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(9, 9, 9))
                            .addGroup(jPanel6Layout.createSequentialGroup()
                                    .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel6Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel6Layout.createSequentialGroup()
                                                    .addGroup(jPanel6Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jButton5).addComponent(jButton10))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(jPanel6Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.BASELINE)
                                                            .addComponent(jLabel4).addComponent(jLabel10))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jLabel5,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 24,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(0, 0, Short.MAX_VALUE)))
                                    .addContainerGap()))));

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(jPanel6,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addComponent(jPanel6,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));

    jTabbedPane1.addTab("    My Portfolio    ", jPanel5);

    jTextField1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    jTextField1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField1ActionPerformed(evt);
        }
    });

    jButton1.setText("Search");
    jButton1.setAlignmentY(0.3F);
    jButton1.setAutoscrolls(true);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

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

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addGap(2, 2, 2)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 82,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(jButton2)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2))
                    .addContainerGap()));

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 145,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(51, 51, 51)));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField1).addComponent(jPanel3,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    jLabel1.setText("Name of Company to look for : ");

    jTable3.setModel(a);
    jScrollPane5.setViewportView(jTable3);
    jScrollPane5.setVisible(false);

    jButton6.setText("Refresh Company");
    jButton6.setVisible(false);
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });

    jLabel2.setText(null);
    jLabel2.setVisible(false);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane5)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel4Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addGroup(jPanel4Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel2).addComponent(jButton6))))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    jPanel4Layout.createSequentialGroup().addGap(5, 5, 5).addComponent(jButton6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 39,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(19, 19, 19)));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addComponent(jPanel4,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(82, 82, 82)
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel1).addComponent(jSeparator1,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 598,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(0, 236, Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(36, 36, 36).addComponent(jLabel1)
                    .addGap(18, 18, 18)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 16,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(210, Short.MAX_VALUE)));

    jTabbedPane1.addTab("    Search    ", jPanel1);

    jList1.setModel(modelCompaniesName);
    jList1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jList1MouseClicked(evt);
        }
    });
    jScrollPane3.setViewportView(jList1);

    jLabel3.setText("  List of Companies (NASDAQ)");

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout
            .setHorizontalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(jPanel8Layout.createSequentialGroup().addComponent(jLabel3).addGap(0, 50,
                            Short.MAX_VALUE)));
    jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    jPanel8Layout.createSequentialGroup().addGap(5, 5, 5).addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(
                                    jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 613, Short.MAX_VALUE)));

    jButton4.setText("Refresh All");
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });

    jButton9.setVisible(false);
    jButton9.setText("Quit");
    jButton9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton9ActionPerformed(evt);
        }
    });

    jLabel9.setText("All prices are in .");

    jLabel8.setVisible(false);

    jButton8.setText("Stop");
    jButton8.setVisible(false);

    jTextField2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField2ActionPerformed(evt);
        }
    });

    jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jPasswordField1ActionPerformed(evt);
        }
    });

    jButton11.setText("Log in");
    jButton11.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton11ActionPerformed(evt);
        }
    });

    jButton12.setText("Create account");
    jButton12.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton12ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout
            .setHorizontalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 150,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 138,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel7Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 97,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jButton12, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap()));

    jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { jPasswordField1, jTextField2 });

    jPanel7Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { jButton11, jButton12 });

    jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 29,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 30,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton11))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton12).addContainerGap()));

    jPanel7Layout.linkSize(javax.swing.SwingConstants.VERTICAL,
            new java.awt.Component[] { jPasswordField1, jTextField2 });

    jLabel11.setFont(new java.awt.Font("Tahoma", 0, 17)); // NOI18N

    jButton17.setText("Log out");
    jButton17.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton17ActionPerformed(evt);
        }
    });

    jButton18.setText("Change Limit");
    jButton18.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton18ActionPerformed(evt);
        }
    });

    jTextField3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jTextField3ActionPerformed(evt);
        }
    });

    jPanel9.setVisible(false);

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                    .addContainerGap(18, Short.MAX_VALUE)
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 39,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jButton18))
                            .addGroup(jPanel9Layout.createSequentialGroup()
                                    .addGroup(jPanel9Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    jPanel9Layout.createSequentialGroup().addComponent(jLabel11)
                                                            .addGap(30, 30, 30))
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                    jPanel9Layout.createSequentialGroup().addComponent(jLabel12)
                                                            .addGap(18, 18, 18)))
                                    .addComponent(jButton17)))
                    .addGap(36, 36, 36)));
    jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel9Layout.createSequentialGroup().addComponent(jLabel11)
                                    .addGap(18, 18, 18).addComponent(jLabel12))
                            .addComponent(jButton17))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton18).addGroup(jPanel9Layout.createSequentialGroup()
                                            .addGap(1, 1, 1).addComponent(jTextField3)))
                    .addContainerGap()));

    jLabel6.setVisible(false);

    jMenu1.setText("File");

    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText("Quit");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jMenu1.add(jMenuItem1);

    jMenuBar1.add(jMenu1);

    jMenu2.setText("Help");

    jMenuItem2.setText("About");
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem2ActionPerformed(evt);
        }
    });
    jMenu2.add(jMenuItem2);

    jMenuBar1.add(jMenu2);

    setJMenuBar(jMenuBar1);

    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().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup().addComponent(jButton4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton8)))
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                            .addComponent(jLabel6)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel8).addGap(85, 85, 85).addComponent(jLabel7)
                                            .addGap(77, 77, 77).addComponent(jButton9))
                                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 931,
                                            Short.MAX_VALUE)
                                    .addGroup(layout.createSequentialGroup().addComponent(jLabel9)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(53, 53, 53).addComponent(jPanel7,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(18, 18, 18))
                            .addGroup(layout.createSequentialGroup().addComponent(jLabel15)
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup()
                            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jButton9).addComponent(jButton4).addComponent(jLabel8)
                                    .addComponent(jButton8).addComponent(jLabel6).addComponent(jLabel7))
                            .addContainerGap())
            .addGroup(layout.createSequentialGroup().addGap(16, 16, 16).addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup().addGap(68, 68, 68)
                                            .addComponent(jLabel9))
                                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 515,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel15)
                    .addGap(0, 0, Short.MAX_VALUE)));

    jTabbedPane1.getAccessibleContext().setAccessibleName("");

    pack();
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.TemplateEditor.java

/**
 * Fill in the JList's model from the list of fields.
 * @param tableInfo the table who's list we should use
 *///from  ww w  .  ja v  a  2s  . c om
protected void fillFieldList(final TableInfo tableInfo) {
    DefaultListModel model = (DefaultListModel) fieldList.getModel();
    model.clear();
    fieldList.clearSelection();

    if (tableInfo != null) {
        for (FieldInfo fi : tableInfo.getFieldItems()) {
            model.addElement(fi);
        }
    }
}

From source file:GUI.MainWindow.java

private void doImport() {
    // Get the file selector popup
    int returnVal = this.fileChooser.showOpenDialog(this);

    if (returnVal == JFileChooser.APPROVE_OPTION) {
        // Clear previous importing list
        this.importingListModel = new DefaultListModel();
        File[] importing_files = fileChooser.getSelectedFiles();
        for (File file : importing_files) {
            ImportFile impFile = new ImportFile(file.getAbsolutePath());

            this.properties.setProperty("Last_Accessed_Directory", impFile.getParent());
            System.out.println("Last_Accessed_Directory Updated: " + impFile.getParent());

            DefaultListModel dlm = new DefaultListModel();
            dlm.addElement(impFile);
            ImportFile.setModel(dlm);/*from   www .jav  a2s  .  co  m*/
            String fileType = universal_file_importer.getFileType(file);
            if (fileType.equalsIgnoreCase("Unknown")) {
                String message = "Did not understand that file type, cannot import that.";
                String title = "Cannot Import File";

                JOptionPane.showMessageDialog(null, message, title, JOptionPane.ERROR_MESSAGE);
                System.out.println(title);
                System.out.println("User informed by popup, cleanly ignoring the file");
            } else {
                FileType.setText(fileType);
                FileSize.setText("" + new Helper().getFileSizeInMB(impFile));
                ImportScanScreen.setLocationRelativeTo(this);
                ImportScanScreen.setVisible(true);
            }
        }

    }
}

From source file:edu.ku.brc.af.tasks.subpane.formeditor.ViewSetSelectorPanel.java

/**
 * /*from  w w w  . j av  a 2s  .  c o m*/
 */
protected void levelSelected() {
    selectedViewSet = null;
    selectedView = null;
    selectedViewDef = null;
    selectedAltView = null;

    ((DefaultTreeModel) tree.getModel()).setRoot(null);

    DefaultListModel model = (DefaultListModel) viewsList.getModel();
    model.clear();

    model = (DefaultListModel) altViewsList.getModel();
    model.clear();

    model = (DefaultListModel) viewSetsList.getModel();
    model.clear();
    viewSetVector.clear();

    DataProviderSessionIFace session = DataProviderFactory.getInstance().createSession();
    for (SpAppResourceDir dir : ((SpecifyAppContextMgr) AppContextMgr.getInstance()).getSpAppResourceList()) {
        if (dir.getSpAppResourceDirId() != null) {
            session.attach(dir);
        }
        //for (SpViewSetObj viewSetObj : dir.getSpViewSets())
        //{
        //model.addElement(viewSetObj.getName());
        for (SpViewSetObj vso : dir.getSpViewSets()) {
            try {
                Element root = XMLHelper.readStrToDOM4J(vso.getDataAsString());
                ViewSet viewSet = new ViewSet(root, false);
                viewSetVector.add(viewSet);
                //System.out.println(viewSet);
                model.addElement(viewSet.getName());

            } catch (Exception ex) {
                edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
                edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ViewSetSelectorPanel.class, ex);
                //log.error(vso.getName());
                //log.error(ex);
                ex.printStackTrace();
                throw new RuntimeException(ex);
            }
        }
        //}
    }
    session.close();
}

From source file:de.tor.tribes.ui.views.DSWorkbenchReTimerFrame.java

private void fireAddTroopFilterEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireAddTroopFilterEvent
    UnitHolder unit = (UnitHolder) jFilterUnitBox.getSelectedItem();
    DefaultListModel filterModel = (DefaultListModel) jFilterList.getModel();
    TroopFilterElement elem = null;//  w w w.  j a v a 2  s  . co m
    int min = Integer.MIN_VALUE;
    int max = Integer.MAX_VALUE;
    try {
        min = Integer.parseInt(jMinValue.getText());
    } catch (Exception e) {
        min = Integer.MIN_VALUE;
    }
    try {
        max = Integer.parseInt(jMaxValue.getText());
    } catch (Exception e) {
        max = Integer.MAX_VALUE;
    }
    if (min > max) {
        int tmp = min;
        min = max;
        max = tmp;
        jMinValue.setText("" + min);
        jMaxValue.setText("" + max);
    }

    for (int i = 0; i < filterModel.size(); i++) {
        TroopFilterElement listElem = (TroopFilterElement) filterModel.get(i);
        if (listElem.getUnit().equals(unit)) {
            //update min and max and return
            listElem.setMin(min);
            listElem.setMax(max);
            jFilterList.repaint();
            return;
        }
    }
    if (elem == null) {
        elem = new TroopFilterElement(unit, min, max);
        filterModel.addElement(elem);
    }
}