Example usage for java.awt Cursor DEFAULT_CURSOR

List of usage examples for java.awt Cursor DEFAULT_CURSOR

Introduction

In this page you can find the example usage for java.awt Cursor DEFAULT_CURSOR.

Prototype

int DEFAULT_CURSOR

To view the source code for java.awt Cursor DEFAULT_CURSOR.

Click Source Link

Document

The default cursor type (gets set if no cursor is defined).

Usage

From source file:client.welcome2.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  ww.jav  a 2s. c  o  m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    SearchHistoryGroup = new javax.swing.ButtonGroup();
    ProjectReportGroup = new javax.swing.ButtonGroup();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jSeparator1 = new javax.swing.JSeparator();
    logoutButton = new javax.swing.JButton();
    suppliersButton = new javax.swing.JButton();
    reportsButton = new javax.swing.JButton();
    jLayeredPane1 = new javax.swing.JLayeredPane();
    suppliersTab = new javax.swing.JTabbedPane();
    AddSupplierPanel = new javax.swing.JPanel();
    SupplierIDLabel = new javax.swing.JLabel();
    SupplierIDText = new javax.swing.JTextField();
    SupplierNameLabel = new javax.swing.JLabel();
    SupplierNameText = new javax.swing.JTextField();
    SupplierAddressLabel = new javax.swing.JLabel();
    SupplierAddressText = new javax.swing.JTextField();
    SupplierPhoneLabel = new javax.swing.JLabel();
    SupplierPhoneText = new javax.swing.JTextField();
    SupplierEmailLabel = new javax.swing.JLabel();
    SupplierEmailText = new javax.swing.JTextField();
    SupplierContractPanel = new javax.swing.JPanel();
    SupplierlContractLabel = new javax.swing.JLabel();
    SupplierContractIDLabel = new javax.swing.JLabel();
    SupplierContracdIDText = new javax.swing.JTextField();
    SupplierUploadText = new javax.swing.JTextField();
    SupplierUploadContractButton = new javax.swing.JButton();
    SupplierShowContractButton = new javax.swing.JButton();
    SupplierAddButton = new javax.swing.JButton();
    ClearButton = new javax.swing.JButton();
    background_green1 = new javax.swing.JLabel();
    UpdateSupplierPanel = new javax.swing.JPanel();
    SupplierSearchText1 = new javax.swing.JTextField();
    EnterYourSearchLabel6 = new javax.swing.JLabel();
    SupplierIdRadioButton = new javax.swing.JRadioButton();
    SupplierNameRadioButton = new javax.swing.JRadioButton();
    SupplierSearchButton = new javax.swing.JButton();
    SupplierNameLabel1 = new javax.swing.JLabel();
    SupplierNameText1 = new javax.swing.JTextField();
    SupplierAddressLabel1 = new javax.swing.JLabel();
    SupplierAddressText1 = new javax.swing.JTextField();
    SupplierPhoneText1 = new javax.swing.JTextField();
    SupplierPhoneLabel1 = new javax.swing.JLabel();
    SupplierEmailLabel1 = new javax.swing.JLabel();
    SupplierEmailText1 = new javax.swing.JTextField();
    jScrollPane17 = new javax.swing.JScrollPane();
    SuppliersTable = new javax.swing.JTable();
    SupplierUpdateButton = new javax.swing.JButton();
    SupplierDeleteButton = new javax.swing.JButton();
    SupplierRefreshButton = new javax.swing.JButton();
    ContractPanel = new javax.swing.JPanel();
    contract_Label1 = new javax.swing.JLabel();
    SupplierUploadText1 = new javax.swing.JTextField();
    SupplierUploadContractButton1 = new javax.swing.JButton();
    jLabel42 = new javax.swing.JLabel();
    SupplierShowButton = new javax.swing.JButton();
    SupplierContractIDLabel1 = new javax.swing.JLabel();
    SupplierContractIDText1 = new javax.swing.JTextField();
    background_green2 = new javax.swing.JLabel();
    SearchSupplierPanel = new javax.swing.JPanel();
    jScrollPane18 = new javax.swing.JScrollPane();
    SuppliersSearchTable = new javax.swing.JTable();
    SupplierRefreshButton1 = new javax.swing.JButton();
    EnterYourSearchLabel7 = new javax.swing.JLabel();
    SupplierSearchText2 = new javax.swing.JTextField();
    SupplierIdRadioButton1 = new javax.swing.JRadioButton();
    SupplierNameRadioButton1 = new javax.swing.JRadioButton();
    SupplierSearchButton1 = new javax.swing.JButton();
    Supplier_Show_Contract_Button = new javax.swing.JButton();
    background_green3 = new javax.swing.JLabel();
    SupplierContractIDText2 = new javax.swing.JTextField();
    projectsTab = new javax.swing.JTabbedPane();
    AddProjectPanel = new javax.swing.JPanel();
    projIDtxt = new javax.swing.JTextField();
    projNametxt = new javax.swing.JTextField();
    projStartDate = new com.toedter.calendar.JDateChooser();
    projDueDate = new com.toedter.calendar.JDateChooser();
    jScrollPane13 = new javax.swing.JScrollPane();
    projDesctxt = new javax.swing.JTextArea();
    projAddButton = new javax.swing.JButton();
    projClearButton = new javax.swing.JButton();
    ProjectIDLabel = new javax.swing.JLabel();
    ProjectNameLabel = new javax.swing.JLabel();
    ProjectStartdateLabel = new javax.swing.JLabel();
    ProjectDuedateLabel = new javax.swing.JLabel();
    ProjectCommentsLabel = new javax.swing.JLabel();
    background_green11 = new javax.swing.JLabel();
    StatusProjectPanel = new javax.swing.JPanel();
    jScrollPane14 = new javax.swing.JScrollPane();
    projUpTable = new javax.swing.JTable();
    projUpDueDate = new com.toedter.calendar.JDateChooser();
    projUpStatusChoice = new java.awt.Choice();
    projUpStatusButton = new javax.swing.JButton();
    projUpRefreshButton = new javax.swing.JButton();
    projUpSearchButton = new javax.swing.JButton();
    projSearchUptxt = new javax.swing.JTextField();
    projNameRadioButton = new javax.swing.JRadioButton();
    projIDRadioButton = new javax.swing.JRadioButton();
    jScrollPane15 = new javax.swing.JScrollPane();
    projComUptxt = new javax.swing.JTextArea();
    EnterYourSearchLabel9 = new javax.swing.JLabel();
    jLabel22 = new javax.swing.JLabel();
    jLabel23 = new javax.swing.JLabel();
    jLabel24 = new javax.swing.JLabel();
    background_green12 = new javax.swing.JLabel();
    SearchProjectPanel = new javax.swing.JPanel();
    projSearchtxt = new javax.swing.JTextField();
    projSearchButton = new javax.swing.JButton();
    projNameRadioButton1 = new javax.swing.JRadioButton();
    projIDRadioButton1 = new javax.swing.JRadioButton();
    jScrollPane16 = new javax.swing.JScrollPane();
    projSearchTable = new javax.swing.JTable();
    projRefreshSearchButton = new javax.swing.JButton();
    EnterYourSearchLabel10 = new javax.swing.JLabel();
    background_green13 = new javax.swing.JLabel();
    reportsTab = new javax.swing.JTabbedPane();
    ProjectReportPanel = new javax.swing.JPanel();
    genRepButton = new javax.swing.JToggleButton();
    pBeginDateChooser = new com.toedter.calendar.JDateChooser();
    pEndDateChooser = new com.toedter.calendar.JDateChooser();
    jLabel2 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    Show_report_Button = new javax.swing.JButton();
    jLabel8 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    PendingRadioButton = new javax.swing.JRadioButton();
    AllRadioButton = new javax.swing.JRadioButton();
    ProgressRadioButton = new javax.swing.JRadioButton();
    CompletedRadioButton = new javax.swing.JRadioButton();
    background_green15 = new javax.swing.JLabel();
    HistoryPanel = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    repHistoryTable = new javax.swing.JTable();
    repSearchButton = new javax.swing.JButton();
    repDateSearchtxt = new com.toedter.calendar.JDateChooser();
    searchRepDateRadioButton = new javax.swing.JRadioButton();
    searchRepIDRadioButton = new javax.swing.JRadioButton();
    searchRepStatRadioButton = new javax.swing.JRadioButton();
    repIDSearchtxt = new javax.swing.JTextField();
    showRepSearchButton = new javax.swing.JButton();
    repProjStatchoice = new java.awt.Choice();
    EnterYourSearchLabel2 = new javax.swing.JLabel();
    RefreshButton2 = new javax.swing.JButton();
    background_green16 = new javax.swing.JLabel();
    projectsButton = new javax.swing.JButton();
    jLabel9 = new javax.swing.JLabel();
    manageUserButtonLabel = new javax.swing.JLabel();
    changePasswordLabel = new javax.swing.JLabel();
    dropManageUserLabel = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    setUndecorated(true);
    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel3.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jLabel3MouseMoved(evt);
        }
    });
    jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jLabel3MouseClicked(evt);
        }
    });
    getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(1151, 3, 35, 22));

    jLabel4.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jLabel4MouseClicked(evt);
        }
    });
    getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(1223, 4, 55, 20));

    jSeparator1.setPreferredSize(new java.awt.Dimension(55, 10));
    getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 222, 1240, 10));

    logoutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/logout button.png"))); // NOI18N
    logoutButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            logoutButtonActionPerformed(evt);
        }
    });
    getContentPane().add(logoutButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, 30, 30));

    suppliersButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Suppliers icon 53 x 50.png"))); // NOI18N
    suppliersButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            suppliersButtonActionPerformed(evt);
        }
    });
    getContentPane().add(suppliersButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(510, 110, 65, 60));

    reportsButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Reports icon 53 x 50.png"))); // NOI18N
    reportsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            reportsButtonActionPerformed(evt);
        }
    });
    getContentPane().add(reportsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 110, 65, 60));

    suppliersTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    suppliersTab.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            suppliersTabMouseClicked(evt);
        }
    });

    AddSupplierPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    SupplierIDLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierIDLabel.setText("Supplier ID");
    AddSupplierPanel.add(SupplierIDLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 70, -1, -1));

    SupplierIDText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierIDTextActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierIDText, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 70, 160, -1));

    SupplierNameLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierNameLabel.setText("Supplier Name");
    AddSupplierPanel.add(SupplierNameLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 110, -1, -1));

    SupplierNameText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierNameTextActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierNameText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 110, 160, -1));

    SupplierAddressLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierAddressLabel.setText("Address");
    AddSupplierPanel.add(SupplierAddressLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 150, -1, -1));

    SupplierAddressText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierAddressTextActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierAddressText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 150, 160, -1));

    SupplierPhoneLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierPhoneLabel.setText("Phone Number");
    AddSupplierPanel.add(SupplierPhoneLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 190, -1, -1));

    SupplierPhoneText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierPhoneTextActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierPhoneText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 190, 160, -1));

    SupplierEmailLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierEmailLabel.setText("E-mail");
    AddSupplierPanel.add(SupplierEmailLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 230, -1, -1));

    SupplierEmailText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierEmailTextActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierEmailText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 230, 160, -1));

    SupplierContractPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
    SupplierContractPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    SupplierlContractLabel.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N
    SupplierlContractLabel.setText("Supplier Contract");
    SupplierContractPanel.add(SupplierlContractLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));

    SupplierContractIDLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierContractIDLabel.setText("Contract ID");
    SupplierContractPanel.add(SupplierContractIDLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, -1, -1));

    SupplierContracdIDText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierContracdIDTextActionPerformed(evt);
        }
    });
    SupplierContractPanel.add(SupplierContracdIDText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 50, 80, -1));

    SupplierUploadText.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierUploadTextActionPerformed(evt);
        }
    });
    SupplierContractPanel.add(SupplierUploadText,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 50, 150, -1));

    SupplierUploadContractButton.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
    SupplierUploadContractButton.setText("Upload");
    SupplierUploadContractButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierUploadContractButtonActionPerformed(evt);
        }
    });
    SupplierContractPanel.add(SupplierUploadContractButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 80, -1, -1));

    SupplierShowContractButton.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
    SupplierShowContractButton.setText("Show");
    SupplierShowContractButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierShowContractButtonActionPerformed(evt);
        }
    });
    SupplierContractPanel.add(SupplierShowContractButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 80, 70, -1));

    AddSupplierPanel.add(SupplierContractPanel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 70, 387, 130));

    SupplierAddButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    SupplierAddButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/plus_icon.png"))); // NOI18N
    SupplierAddButton.setText("Add");
    SupplierAddButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierAddButtonActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(SupplierAddButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 210, -1, -1));

    ClearButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    ClearButton.setText("Clear");
    ClearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ClearButtonActionPerformed(evt);
        }
    });
    AddSupplierPanel.add(ClearButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 210, 100, 40));

    background_green1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    AddSupplierPanel.add(background_green1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -10, 1250, 440));

    suppliersTab.addTab("Add Suppliers", AddSupplierPanel);

    UpdateSupplierPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    UpdateSupplierPanel.add(SupplierSearchText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    EnterYourSearchLabel6.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel6.setText("Enter your search");
    UpdateSupplierPanel.add(EnterYourSearchLabel6,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    SupplierIdRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierIdRadioButton.setText("By ID");
    SupplierIdRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    SupplierIdRadioButton.setBorderPainted(true);
    SupplierIdRadioButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    SupplierIdRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierIdRadioButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierIdRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    SupplierNameRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierNameRadioButton.setText("By Name");
    SupplierNameRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    SupplierNameRadioButton.setBorderPainted(true);
    SupplierNameRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierNameRadioButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierNameRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    SupplierSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    SupplierSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    SupplierSearchButton.setText("Search");
    SupplierSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierSearchButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));

    SupplierNameLabel1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierNameLabel1.setText("Supplier Name");
    UpdateSupplierPanel.add(SupplierNameLabel1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, -1));

    SupplierNameText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierNameText1ActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierNameText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 130, 130, -1));

    SupplierAddressLabel1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierAddressLabel1.setText("Address");
    UpdateSupplierPanel.add(SupplierAddressLabel1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 170, 70, -1));

    SupplierAddressText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierAddressText1ActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierAddressText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 170, 130, -1));

    SupplierPhoneText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierPhoneText1ActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierPhoneText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 210, 130, -1));

    SupplierPhoneLabel1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierPhoneLabel1.setText("Phone");
    UpdateSupplierPanel.add(SupplierPhoneLabel1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 210, 70, -1));

    SupplierEmailLabel1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierEmailLabel1.setText("Email");
    UpdateSupplierPanel.add(SupplierEmailLabel1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 250, 70, -1));

    SupplierEmailText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierEmailText1ActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierEmailText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 250, 130, -1));

    SuppliersTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    SuppliersTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            SuppliersTableMouseClicked(evt);
        }
    });
    jScrollPane17.setViewportView(SuppliersTable);

    UpdateSupplierPanel.add(jScrollPane17,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 810, 220));

    SupplierUpdateButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    SupplierUpdateButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/save-icon-30.png"))); // NOI18N
    SupplierUpdateButton.setText("Update");
    SupplierUpdateButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierUpdateButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierUpdateButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 250, -1, -1));

    SupplierDeleteButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    SupplierDeleteButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/delete icon.png"))); // NOI18N
    SupplierDeleteButton.setText("Delete");
    SupplierDeleteButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierDeleteButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierDeleteButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(880, 250, -1, -1));

    SupplierRefreshButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    SupplierRefreshButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    SupplierRefreshButton.setText("Refresh");
    SupplierRefreshButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierRefreshButtonActionPerformed(evt);
        }
    });
    UpdateSupplierPanel.add(SupplierRefreshButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    ContractPanel.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
    ContractPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    contract_Label1.setFont(new java.awt.Font("Calibri", 1, 24)); // NOI18N
    contract_Label1.setText("Contract Update");
    ContractPanel.add(contract_Label1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, 170, 30));

    SupplierUploadText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierUploadText1ActionPerformed(evt);
        }
    });
    ContractPanel.add(SupplierUploadText1, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 40, 150, -1));

    SupplierUploadContractButton1.setText("Upload");
    SupplierUploadContractButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierUploadContractButton1ActionPerformed(evt);
        }
    });
    ContractPanel.add(SupplierUploadContractButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 90, -1, -1));

    jLabel42.setFont(new java.awt.Font("Calibri", 0, 11)); // NOI18N
    jLabel42.setForeground(new java.awt.Color(255, 0, 0));
    jLabel42.setText("Please upload the new contract if changes are made");
    ContractPanel.add(jLabel42, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 70, -1, -1));

    SupplierShowButton.setText("Show");
    SupplierShowButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierShowButtonActionPerformed(evt);
        }
    });
    ContractPanel.add(SupplierShowButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 90, 70, -1));

    SupplierContractIDLabel1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierContractIDLabel1.setText("Contract ID");
    ContractPanel.add(SupplierContractIDLabel1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 40, -1, -1));

    SupplierContractIDText1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierContractIDText1ActionPerformed(evt);
        }
    });
    ContractPanel.add(SupplierContractIDText1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 40, 80, -1));

    UpdateSupplierPanel.add(ContractPanel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 250, 370, 130));

    background_green2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    UpdateSupplierPanel.add(background_green2,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -20, 1250, 450));

    suppliersTab.addTab("Update", UpdateSupplierPanel);

    SearchSupplierPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    SuppliersSearchTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    SuppliersSearchTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            SuppliersSearchTableMouseClicked(evt);
        }
    });
    jScrollPane18.setViewportView(SuppliersSearchTable);

    SearchSupplierPanel.add(jScrollPane18,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 810, 220));

    SupplierRefreshButton1.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    SupplierRefreshButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    SupplierRefreshButton1.setText("Refresh");
    SupplierRefreshButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierRefreshButton1ActionPerformed(evt);
        }
    });
    SearchSupplierPanel.add(SupplierRefreshButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    EnterYourSearchLabel7.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel7.setText("Enter your search");
    SearchSupplierPanel.add(EnterYourSearchLabel7,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));
    SearchSupplierPanel.add(SupplierSearchText2,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    SupplierIdRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierIdRadioButton1.setText("By ID");
    SupplierIdRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    SupplierIdRadioButton1.setBorderPainted(true);
    SupplierIdRadioButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    SupplierIdRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierIdRadioButton1ActionPerformed(evt);
        }
    });
    SearchSupplierPanel.add(SupplierIdRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    SupplierNameRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    SupplierNameRadioButton1.setText("By Name");
    SupplierNameRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    SupplierNameRadioButton1.setBorderPainted(true);
    SupplierNameRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierNameRadioButton1ActionPerformed(evt);
        }
    });
    SearchSupplierPanel.add(SupplierNameRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    SupplierSearchButton1.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    SupplierSearchButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    SupplierSearchButton1.setText("Search");
    SupplierSearchButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SupplierSearchButton1ActionPerformed(evt);
        }
    });
    SearchSupplierPanel.add(SupplierSearchButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));

    Supplier_Show_Contract_Button.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    Supplier_Show_Contract_Button
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icon-service-contract.png"))); // NOI18N
    Supplier_Show_Contract_Button.setText("Show Contract");
    Supplier_Show_Contract_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Supplier_Show_Contract_ButtonActionPerformed(evt);
        }
    });
    SearchSupplierPanel.add(Supplier_Show_Contract_Button,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(810, 250, 190, 40));

    background_green3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    SearchSupplierPanel.add(background_green3,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -40, 1250, 460));

    SupplierContractIDText2.setText("jTextField1");
    SearchSupplierPanel.add(SupplierContractIDText2,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 200, -1, -1));

    suppliersTab.addTab("Search", SearchSupplierPanel);

    projectsTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projectsTab.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            projectsTabMouseClicked(evt);
        }
    });

    AddProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    AddProjectPanel.add(projIDtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 70, 118, -1));
    AddProjectPanel.add(projNametxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 120, 120, -1));

    projStartDate.setDateFormatString("yyyy-MM-dd");
    projStartDate.setMinSelectableDate(new Date());
    AddProjectPanel.add(projStartDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 170, 127, -1));

    projDueDate.setMinSelectableDate(new Date());
    AddProjectPanel.add(projDueDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 220, 127, -1));

    projDesctxt.setColumns(10);
    projDesctxt.setRows(2);
    projDesctxt.setTabSize(0);
    jScrollPane13.setViewportView(projDesctxt);

    AddProjectPanel.add(jScrollPane13, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 260, 180, 70));

    projAddButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projAddButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/plus_icon.png"))); // NOI18N
    projAddButton.setText("Add");
    projAddButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projAddButtonActionPerformed(evt);
        }
    });
    AddProjectPanel.add(projAddButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 330, -1, -1));

    projClearButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projClearButton.setText("Clear");
    projClearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projClearButtonActionPerformed(evt);
        }
    });
    AddProjectPanel.add(projClearButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 330, 100, 40));

    ProjectIDLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectIDLabel.setText("Project ID");
    AddProjectPanel.add(ProjectIDLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 70, -1, -1));

    ProjectNameLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectNameLabel.setText("Project Name");
    AddProjectPanel.add(ProjectNameLabel, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 120, -1, -1));

    ProjectStartdateLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectStartdateLabel.setText("Start Date");
    AddProjectPanel.add(ProjectStartdateLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 170, -1, -1));

    ProjectDuedateLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectDuedateLabel.setText("Due Date");
    AddProjectPanel.add(ProjectDuedateLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 220, -1, -1));

    ProjectCommentsLabel.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProjectCommentsLabel.setText("Comments");
    AddProjectPanel.add(ProjectCommentsLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 270, -1, -1));

    background_green11.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    AddProjectPanel.add(background_green11,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -20, 1250, 430));

    projectsTab.addTab("Add Project", AddProjectPanel);

    StatusProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    projUpTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null },
                    { null, null, null, null, null, null }, { null, null, null, null, null, null } },
            new String[] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6" }));
    projUpTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            projUpTableMouseClicked(evt);
        }
    });
    jScrollPane14.setViewportView(projUpTable);

    StatusProjectPanel.add(jScrollPane14, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 800, 220));

    projUpDueDate.setMinSelectableDate(new Date());
    StatusProjectPanel.add(projUpDueDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 130, 140, -1));

    projUpStatusChoice.addItem("Pending");
    projUpStatusChoice.addItem("In Progress");
    projUpStatusChoice.addItem("Completed");
    StatusProjectPanel.add(projUpStatusChoice,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 170, 100, -1));

    projUpStatusButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projUpStatusButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/save-icon-30.png"))); // NOI18N
    projUpStatusButton.setText("Update");
    projUpStatusButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpStatusButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpStatusButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(870, 250, -1, -1));

    projUpRefreshButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projUpRefreshButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    projUpRefreshButton.setText("Refresh");
    projUpRefreshButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpRefreshButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpRefreshButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    projUpSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projUpSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    projUpSearchButton.setText("Search");
    projUpSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projUpSearchButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projUpSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));
    StatusProjectPanel.add(projSearchUptxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    projNameRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projNameRadioButton.setText("By Name");
    projNameRadioButton
            .setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
    projNameRadioButton.setBorderPainted(true);
    projNameRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projNameRadioButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projNameRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    projIDRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projIDRadioButton.setText("By ID");
    projIDRadioButton
            .setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
    projIDRadioButton.setBorderPainted(true);
    projIDRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projIDRadioButtonActionPerformed(evt);
        }
    });
    StatusProjectPanel.add(projIDRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    projComUptxt.setColumns(10);
    projComUptxt.setRows(2);
    projComUptxt.setTabSize(0);
    jScrollPane15.setViewportView(projComUptxt);

    StatusProjectPanel.add(jScrollPane15, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 210, 140, 70));

    EnterYourSearchLabel9.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel9.setText("Enter your search");
    StatusProjectPanel.add(EnterYourSearchLabel9,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    jLabel22.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel22.setText(" Due Date");
    StatusProjectPanel.add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, -1));

    jLabel23.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel23.setText("Project Status");
    StatusProjectPanel.add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 170, -1, -1));

    jLabel24.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    jLabel24.setText("Comments");
    StatusProjectPanel.add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 210, -1, -1));

    background_green12.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    StatusProjectPanel.add(background_green12,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -30, 1250, 460));

    projectsTab.addTab(" Status", StatusProjectPanel);

    SearchProjectPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    SearchProjectPanel.add(projSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 160, -1));

    projSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    projSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    projSearchButton.setText("Search");
    projSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projSearchButtonActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(190, 40, -1, -1));

    projNameRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projNameRadioButton1.setText("By Name");
    projNameRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    projNameRadioButton1.setBorderPainted(true);
    projNameRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projNameRadioButton1ActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projNameRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 80, 90, -1));

    projIDRadioButton1.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    projIDRadioButton1.setText("By ID");
    projIDRadioButton1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    projIDRadioButton1.setBorderPainted(true);
    projIDRadioButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projIDRadioButton1ActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projIDRadioButton1,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 60, -1));

    projSearchTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object[][] { { null, null, null, null, null, null }, { null, null, null, null, null, null },
                    { null, null, null, null, null, null }, { null, null, null, null, null, null } },
            new String[] { "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6" }));
    jScrollPane16.setViewportView(projSearchTable);

    SearchProjectPanel.add(jScrollPane16, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 20, 800, 220));

    projRefreshSearchButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    projRefreshSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    projRefreshSearchButton.setText("Refresh");
    projRefreshSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projRefreshSearchButtonActionPerformed(evt);
        }
    });
    SearchProjectPanel.add(projRefreshSearchButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(1010, 250, -1, -1));

    EnterYourSearchLabel10.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel10.setText("Enter your search");
    SearchProjectPanel.add(EnterYourSearchLabel10,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    background_green13.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    SearchProjectPanel.add(background_green13,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -40, 1250, 470));

    projectsTab.addTab("Search", SearchProjectPanel);

    reportsTab.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    reportsTab.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            reportsTabMouseClicked(evt);
        }
    });

    ProjectReportPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    genRepButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    genRepButton.setText("Generate Report");
    genRepButton.setOpaque(true);
    genRepButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            genRepButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(genRepButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 270, -1, 40));

    pBeginDateChooser.setDateFormatString("yyyy-MM-dd");
    ProjectReportPanel.add(pBeginDateChooser,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 120, 130, -1));

    pEndDateChooser.setDateFormatString("yyyy-MM-dd");
    ProjectReportPanel.add(pEndDateChooser,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 170, 130, -1));

    jLabel2.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel2.setText("This report shows all projects from two chosen dates.");
    ProjectReportPanel.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 70, -1, -1));

    jLabel5.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel5.setText("You can see the report here ");
    ProjectReportPanel.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 340, -1, -1));

    jLabel6.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel6.setText("please chose a start date ");
    ProjectReportPanel.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 120, -1, -1));

    jLabel7.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel7.setText("Chose a due date");
    ProjectReportPanel.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 170, -1, -1));

    Show_report_Button.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    Show_report_Button
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icon-service-contract.png"))); // NOI18N
    Show_report_Button.setText("Show Report");
    Show_report_Button.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            Show_report_ButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(Show_report_Button,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 330, 190, 40));

    jLabel8.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel8.setText("Click on ");
    ProjectReportPanel.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 280, -1, -1));

    jLabel10.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    jLabel10.setText("Chose relevant project status");
    ProjectReportPanel.add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 220, -1, -1));

    ProjectReportGroup.add(PendingRadioButton);
    PendingRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    PendingRadioButton.setText("Pending");
    PendingRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    PendingRadioButton.setBorderPainted(true);
    PendingRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            PendingRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(PendingRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(490, 220, 80, -1));

    ProjectReportGroup.add(AllRadioButton);
    AllRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    AllRadioButton.setText("All");
    AllRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    AllRadioButton.setBorderPainted(true);
    AllRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AllRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(AllRadioButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 220, 50, -1));

    ProjectReportGroup.add(ProgressRadioButton);
    ProgressRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    ProgressRadioButton.setText("In Progress");
    ProgressRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    ProgressRadioButton.setBorderPainted(true);
    ProgressRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            ProgressRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(ProgressRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 220, 100, -1));

    ProjectReportGroup.add(CompletedRadioButton);
    CompletedRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    CompletedRadioButton.setText("Completed");
    CompletedRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    CompletedRadioButton.setBorderPainted(true);
    CompletedRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            CompletedRadioButtonActionPerformed(evt);
        }
    });
    ProjectReportPanel.add(CompletedRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 220, 100, -1));

    background_green15.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    ProjectReportPanel.add(background_green15,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    reportsTab.addTab("Project Report", ProjectReportPanel);

    HistoryPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    repHistoryTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    repHistoryTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            repHistoryTableMouseClicked(evt);
        }
    });
    jScrollPane1.setViewportView(repHistoryTable);

    HistoryPanel.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 20, 700, 290));

    repSearchButton.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
    repSearchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/search.png"))); // NOI18N
    repSearchButton.setText("Search");
    repSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            repSearchButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(repSearchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 40, -1, -1));

    repDateSearchtxt.setDateFormatString("yyyy-MM-dd");
    HistoryPanel.add(repDateSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    SearchHistoryGroup.add(searchRepDateRadioButton);
    searchRepDateRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepDateRadioButton.setText("By Project Date");
    searchRepDateRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepDateRadioButton.setBorderPainted(true);
    searchRepDateRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepDateRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepDateRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 90, 130, -1));

    SearchHistoryGroup.add(searchRepIDRadioButton);
    searchRepIDRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepIDRadioButton.setText("By Report ID");
    searchRepIDRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepIDRadioButton.setBorderPainted(true);
    searchRepIDRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepIDRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepIDRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 90, 110, -1));

    SearchHistoryGroup.add(searchRepStatRadioButton);
    searchRepStatRadioButton.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    searchRepStatRadioButton.setText("By Project Status");
    searchRepStatRadioButton.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    searchRepStatRadioButton.setBorderPainted(true);
    searchRepStatRadioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            searchRepStatRadioButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(searchRepStatRadioButton,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 90, 140, -1));
    HistoryPanel.add(repIDSearchtxt, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    showRepSearchButton.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    showRepSearchButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/icon-service-contract.png"))); // NOI18N
    showRepSearchButton.setText("Show Report");
    showRepSearchButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            showRepSearchButtonActionPerformed(evt);
        }
    });
    HistoryPanel.add(showRepSearchButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(810, 320, -1, -1));

    repProjStatchoice.add("All Project Statuses");
    repProjStatchoice.add("Pending Projects");
    repProjStatchoice.add("In Progress Projects");
    repProjStatchoice.add("Completed Projects");
    HistoryPanel.add(repProjStatchoice, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 150, -1));

    EnterYourSearchLabel2.setFont(new java.awt.Font("Calibri", 0, 16)); // NOI18N
    EnterYourSearchLabel2.setText("Enter your search");
    HistoryPanel.add(EnterYourSearchLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

    RefreshButton2.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    RefreshButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/refresh.png"))); // NOI18N
    RefreshButton2.setText("Refresh");
    RefreshButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            RefreshButton2ActionPerformed(evt);
        }
    });
    HistoryPanel.add(RefreshButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1000, 320, -1, -1));

    background_green16.setFont(new java.awt.Font("Calibri", 0, 20)); // NOI18N
    background_green16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/background.png"))); // NOI18N
    HistoryPanel.add(background_green16, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1250, 430));

    reportsTab.addTab("History", HistoryPanel);

    javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1);
    jLayeredPane1.setLayout(jLayeredPane1Layout);
    jLayeredPane1Layout.setHorizontalGroup(jLayeredPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1270, Short.MAX_VALUE)
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(5, 5, 5)
                            .addComponent(projectsTab, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addContainerGap()
                            .addComponent(suppliersTab, javax.swing.GroupLayout.PREFERRED_SIZE, 1250,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addContainerGap()
                            .addComponent(reportsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 1250,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
    jLayeredPane1Layout.setVerticalGroup(jLayeredPane1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 450, Short.MAX_VALUE)
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(5, 5, 5)
                            .addComponent(projectsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(8, 8, 8)
                            .addComponent(suppliersTab, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addGroup(jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jLayeredPane1Layout.createSequentialGroup().addGap(9, 9, 9)
                            .addComponent(reportsTab, javax.swing.GroupLayout.PREFERRED_SIZE, 430,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))));
    jLayeredPane1.setLayer(suppliersTab, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLayeredPane1.setLayer(projectsTab, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLayeredPane1.setLayer(reportsTab, javax.swing.JLayeredPane.DEFAULT_LAYER);

    getContentPane().add(jLayeredPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 220, 1250, 440));

    projectsButton
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/Projects icon 53 x 50.png"))); // NOI18N
    projectsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            projectsButtonActionPerformed(evt);
        }
    });
    getContentPane().add(projectsButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 110, 65, 60));

    jLabel9.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
    getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 160, 180, 40));
    jLabel9.setText(loginGUI.username + " Is Logged in");

    manageUserButtonLabel.setFont(new java.awt.Font("Calibri", 0, 12)); // NOI18N
    manageUserButtonLabel.setText("Manage user");
    manageUserButtonLabel
            .setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    manageUserButtonLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            manageUserButtonLabelMouseReleased(evt);
        }
    });
    getContentPane().add(manageUserButtonLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 110, 80, 20));

    changePasswordLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            changePasswordLabelMouseMoved(evt);
        }
    });
    changePasswordLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            changePasswordLabelMouseClicked(evt);
        }
    });
    getContentPane().add(changePasswordLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 112, 106, 17));

    dropManageUserLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Images/menu.png"))); // NOI18N
    dropManageUserLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            dropManageUserLabelMouseMoved(evt);
        }
    });
    getContentPane().add(dropManageUserLabel,
            new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 110, 120, 40));

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/Images/  ? .png"))); // NOI18N
    jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
    jLabel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jLabel1MouseMoved(evt);
        }
    });
    getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1280, 680));

    pack();
    setLocationRelativeTo(null);
}

From source file:au.org.ala.delta.editor.ui.CharacterTree.java

public void expandAll() {

    try {/*w ww.  j  a va2s  . com*/
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        for (int i = 0; i < getRowCount(); i++) {
            expandRow(i);
        }
    } finally {
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
}

From source file:edu.harvard.mcz.imagecapture.ui.ButtonEditor.java

@Override
public void actionPerformed(ActionEvent e) {

    // Action might not be event_button_pressed on all systems.
    log.debug("Button event actionCommand: " + e.getActionCommand());
    if (e.getActionCommand().equals(EVENT_PRESSED)) {
        // Event is a click on the cell
        // Identify the row that was clicked on.
        JTable table = (JTable) ((JButton) e.getSource()).getParent();
        log.debug(e.getSource());//from   w  w w  . ja va2s .  com
        log.debug(table);
        int row = table.getEditingRow();
        // Stop editing - note, we need to have gotten e.getSource.getParent and getEditingRow first.
        fireEditingStopped(); //Make the renderer reappear.
        Singleton.getSingletonInstance().getMainFrame()
                .setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        switch (formToOpen) {
        case OPEN_SPECIMEN_DETAILS:
            // Load the selected specimen record from its ID (the data value behind the button).
            //SpecimenLifeCycle sls = new SpecimenLifeCycle();
            //Specimen specimen = sls.findById((Long)targetId);
            //if (specimen!=null) {
            if (targetId != null) {
                // a specimen with this ID exists, bring up the details editor.
                try {
                    //SpecimenControler sc = new SpecimenControler(specimen);
                    if (((Specimen) targetId).getSpecimenId() != null) {
                        if (((Specimen) targetId).isStateDone()) {
                            // Specimens in state_done are no longer editable
                            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                                    "This Specimen record has been migrated and can no longer be edited here ["
                                            + ((Specimen) targetId).getLoadFlags()
                                            + "].\nSee: http://mczbase.mcz.harvard.edu/guid/MCZ:Ent:"
                                            + ((Specimen) targetId).getCatNum(),
                                    "Migrated Specimen", JOptionPane.WARNING_MESSAGE);
                        } else {
                            // Specimen is still editable
                            if (table != null) {
                                // Pass the specimen object for the row, the table model, and the row number on to the specimen controler.
                                try {
                                    SpecimenControler sc = new SpecimenControler((Specimen) targetId,
                                            (SpecimenListTableModel) table.getModel(), table, row);
                                    if (table.getParent().getParent().getParent().getParent()
                                            .getClass() == SpecimenBrowser.class) {
                                        sc.addListener((DataChangeListener) table.getParent());
                                    } else {
                                        Component x = table;
                                        boolean done = false;
                                        while (!done) {
                                            log.debug(x.getParent());
                                            x = x.getParent();
                                            if (x.getClass() == SpecimenBrowser.class) {
                                                sc.addListener((DataChangeListener) x);
                                                done = true;
                                            }
                                        }
                                    }
                                    sc.displayInEditor();
                                } catch (java.lang.ClassCastException eNotSp) {
                                    // Request isn't coming from a SpecimenListTableModel
                                    // View just the specimen record.
                                    SpecimenControler sc = new SpecimenControler((Specimen) targetId);
                                    sc.displayInEditor();
                                }
                            } else {
                                log.debug(e.getSource());
                                //SpecimenControler sc = new SpecimenControler((Specimen)targetId);
                                //sc.displayInEditor();
                            }
                        }
                    } else {
                        log.debug("User clicked on table row containing a new Specimen()");
                        JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                                "No Specimen for this image", "Load Specimen Failed",
                                JOptionPane.WARNING_MESSAGE);
                    }
                } catch (NoSuchRecordException e1) {
                    log.error("Tested for specimen!=null, but SpecimenControler threw null specimen exception");
                    log.error(e1);
                }
            } else {
                log.debug("No matches found to specimen id=" + targetId);
                // TODO: Create new specimen record and bring up dialog
                JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                        "No specimen record.");
            }
            break;
        case OPEN_TEMPLATE:
            // Load the selected specimen record from its ID (the data value behind the button).
            try {
                // a template with this targetID exists, display it.
                ((PositionTemplateEditor) parentComponent).setTemplate((String) targetId);
            } catch (NoSuchTemplateException e1) {
                log.error("No such template on button press on a template in list.");
                log.error(e1);
                log.trace(e1);
            }

            break;
        case OPEN_USER:
            //TODO: tie to user
            log.debug("Open user");
            ((UserListBrowser) parentComponent).getEditUserPanel().setUser((Users) targetId);
            break;
        case OPEN_SPECIMEN_VERBATIM:
            log.debug("Open Verbatim Transcription");
            SpecimenLifeCycle sls = new SpecimenLifeCycle();
            List<Specimen> toTranscribe = sls.findForVerbatim(((GenusSpeciesCount) targetId).getGenus(),
                    ((GenusSpeciesCount) targetId).getSpecificEpithet(), WorkFlowStatus.STAGE_1);
            log.debug(toTranscribe.size());
            SpecimenListTableModel stm = new SpecimenListTableModel(toTranscribe);
            JTable stable = new JTable();
            stable.setModel(stm);
            SpecimenControler verbCont;
            try {
                verbCont = new SpecimenControler(toTranscribe.get(0), stm, stable, 0);
                VerbatimCaptureDialog dialog = new VerbatimCaptureDialog(toTranscribe.get(0), verbCont);
                dialog.setVisible(true);
            } catch (NoSuchRecordException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            break;
        case OPEN_VERBATIM_CLASSIFY:
            log.debug("Open Verbatim Classify dialog");
            try {
                VerbatimClassifyDialog dialog = new VerbatimClassifyDialog(
                        (VerbatimCount) table.getModel().getValueAt(row, 0));
                dialog.setVisible(true);
            } catch (ClassCastException e1) {
                log.error(e1.getMessage(), e1);
            }
            break;
        case ACTION_CANCEL_JOB:
            log.debug("Action Cancel requested on job " + targetId);
            Singleton.getSingletonInstance().getJobList().getJobAt((Integer) targetId).cancel();
            break;
        case OPEN_SPECIMENPARTATTRIBUTES:
            SpecimenPartAttributeDialog attrDialog = new SpecimenPartAttributeDialog((SpecimenPart) targetId);
            attrDialog.setVisible(true);
            break;
        }
        Singleton.getSingletonInstance().getMainFrame()
                .setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        System.gc();
    }
}

From source file:org.tinymediamanager.ui.movies.settings.MovieSettingsPanel.java

/**
 * Instantiates a new movie settings panel.
 *///from  w  w  w . ja  v a2  s.  co  m
public MovieSettingsPanel() {
    setLayout(new FormLayout(
            new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
                    FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
                    FormSpecs.RELATED_GAP_COLSPEC, },
            new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                    RowSpec.decode("default:grow"), }));

    JPanel panelGeneral = new JPanel();
    panelGeneral.setBorder(new TitledBorder(null, BUNDLE.getString("Settings.general"), TitledBorder.LEADING, //$NON-NLS-1$
            TitledBorder.TOP, null, null));
    add(panelGeneral, "2, 2, fill, fill");
    panelGeneral.setLayout(new FormLayout(
            new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, },
            new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.UNRELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, }));

    JLabel lblVisiblecolumns = new JLabel(BUNDLE.getString("Settings.movie.visiblecolumns")); //$NON-NLS-1$
    panelGeneral.add(lblVisiblecolumns, "2, 2, right, default");

    chckbxYear = new JCheckBox(BUNDLE.getString("metatag.year")); //$NON-NLS-1$
    panelGeneral.add(chckbxYear, "4, 2");

    chckbxRating = new JCheckBox(BUNDLE.getString("metatag.rating")); //$NON-NLS-1$
    panelGeneral.add(chckbxRating, "6, 2");

    chckbxNfo = new JCheckBox(BUNDLE.getString("metatag.nfo")); //$NON-NLS-1$
    panelGeneral.add(chckbxNfo, "8, 2");

    chckbxMetadata = new JCheckBox(BUNDLE.getString("tmm.metadata")); //$NON-NLS-1$
    panelGeneral.add(chckbxMetadata, "10, 2");

    chckbxDateAdded = new JCheckBox(BUNDLE.getString("metatag.dateadded")); //$NON-NLS-1$
    panelGeneral.add(chckbxDateAdded, "12, 2");

    chckbxImages = new JCheckBox(BUNDLE.getString("metatag.images")); //$NON-NLS-1$
    panelGeneral.add(chckbxImages, "4, 4");

    chckbxTrailer = new JCheckBox(BUNDLE.getString("metatag.trailer")); //$NON-NLS-1$
    panelGeneral.add(chckbxTrailer, "6, 4");

    chckbxSubtitles = new JCheckBox(BUNDLE.getString("metatag.subtitles")); //$NON-NLS-1$
    panelGeneral.add(chckbxSubtitles, "8, 4");

    chckbxWatched = new JCheckBox(BUNDLE.getString("metatag.watched")); //$NON-NLS-1$
    panelGeneral.add(chckbxWatched, "10, 4");

    JLabel lblSaveUiFilter = new JLabel(BUNDLE.getString("Settings.movie.persistuifilter")); //$NON-NLS-1$
    panelGeneral.add(lblSaveUiFilter, "2, 6, right, default");

    chckbxSaveUiFilter = new JCheckBox("");
    panelGeneral.add(chckbxSaveUiFilter, "4, 6");

    JSeparator separator_4 = new JSeparator();
    panelGeneral.add(separator_4, "2, 8, 11, 1");

    JLabel lblImageCache = new JLabel(BUNDLE.getString("Settings.imagecacheimport"));
    panelGeneral.add(lblImageCache, "2, 10, right, default");

    chckbxImageCache = new JCheckBox(BUNDLE.getString("Settings.imagecacheimporthint")); //$NON-NLS-1$
    TmmFontHelper.changeFont(chckbxImageCache, 0.833);
    panelGeneral.add(chckbxImageCache, "4, 10, 7, 1");

    JLabel lblRuntimeFromMedia = new JLabel(BUNDLE.getString("Settings.runtimefrommediafile"));
    panelGeneral.add(lblRuntimeFromMedia, "2, 12, right, default");

    chckbxRuntimeFromMf = new JCheckBox("");
    panelGeneral.add(chckbxRuntimeFromMf, "4, 12");

    JSeparator separator = new JSeparator();
    panelGeneral.add(separator, "2, 14, 11, 1");

    final JLabel lblAutomaticRename = new JLabel(BUNDLE.getString("Settings.movie.automaticrename")); //$NON-NLS-1$
    panelGeneral.add(lblAutomaticRename, "2, 16, right, default");

    chckbxRename = new JCheckBox(BUNDLE.getString("Settings.movie.automaticrename.desc")); //$NON-NLS-1$
    panelGeneral.add(chckbxRename, "4, 16, 7, 1");

    JLabel lblTraktTv = new JLabel(BUNDLE.getString("Settings.trakt"));//$NON-NLS-1$
    panelGeneral.add(lblTraktTv, "2, 18");

    chckbxTraktTv = new JCheckBox("");
    panelGeneral.add(chckbxTraktTv, "4, 18");

    JButton btnClearTraktTvMovies = new JButton(BUNDLE.getString("Settings.trakt.clearmovies"));//$NON-NLS-1$
    btnClearTraktTvMovies.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int confirm = JOptionPane.showOptionDialog(null,
                    BUNDLE.getString("Settings.trakt.clearmovies.hint"),
                    BUNDLE.getString("Settings.trakt.clearmovies"), JOptionPane.YES_NO_OPTION, //$NON-NLS-1$
                    JOptionPane.QUESTION_MESSAGE, null, null, null);
            if (confirm == JOptionPane.YES_OPTION) {
                TmmTask task = new ClearTraktTvTask(true, false);
                TmmTaskManager.getInstance().addUnnamedTask(task);
            }
        }
    });
    panelGeneral.add(btnClearTraktTvMovies, "6, 18, 3, 1, left, default");

    JPanel panelMovieDataSources = new JPanel();

    panelMovieDataSources.setBorder(new TitledBorder(null, BUNDLE.getString("Settings.movie.datasource"), //$NON-NLS-1$
            TitledBorder.LEADING, TitledBorder.TOP, null, null));
    add(panelMovieDataSources, "2, 4, 3, 1, fill, fill");
    panelMovieDataSources.setLayout(new FormLayout(
            new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("150dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC,
                    FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("150dlu:grow(2)"),
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, },
            new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, RowSpec.decode("100px:grow"),
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, }));

    JLabel lblDataSource = new JLabel(BUNDLE.getString("Settings.source")); //$NON-NLS-1$
    panelMovieDataSources.add(lblDataSource, "2, 2, 5, 1");

    JLabel lblIngore = new JLabel(BUNDLE.getString("Settings.ignore")); //$NON-NLS-1$
    panelMovieDataSources.add(lblIngore, "12, 2");

    JScrollPane scrollPaneDataSources = new JScrollPane();
    panelMovieDataSources.add(scrollPaneDataSources, "2, 4, 5, 1, fill, fill");

    listDataSources = new JList<>();
    scrollPaneDataSources.setViewportView(listDataSources);

    JPanel panelMovieSourcesButtons = new JPanel();
    panelMovieDataSources.add(panelMovieSourcesButtons, "8, 4, fill, top");
    panelMovieSourcesButtons
            .setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, }, new RowSpec[] {
                    FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, }));

    JButton btnAdd = new JButton(IconManager.LIST_ADD);
    btnAdd.setToolTipText(BUNDLE.getString("Button.add")); //$NON-NLS-1$
    btnAdd.setMargin(new Insets(2, 2, 2, 2));
    btnAdd.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            Path file = TmmUIHelper.selectDirectory(BUNDLE.getString("Settings.datasource.folderchooser")); //$NON-NLS-1$
            if (file != null && Files.isDirectory(file)) {
                settings.addMovieDataSources(file.toAbsolutePath().toString());
            }
        }
    });

    panelMovieSourcesButtons.add(btnAdd, "1, 1, fill, top");

    JButton btnRemove = new JButton(IconManager.LIST_REMOVE);
    btnRemove.setToolTipText(BUNDLE.getString("Button.remove")); //$NON-NLS-1$
    btnRemove.setMargin(new Insets(2, 2, 2, 2));
    btnRemove.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            int row = listDataSources.getSelectedIndex();
            if (row != -1) { // nothing selected
                String path = MovieModuleManager.MOVIE_SETTINGS.getMovieDataSource().get(row);
                String[] choices = { BUNDLE.getString("Button.continue"), BUNDLE.getString("Button.abort") }; //$NON-NLS-1$
                int decision = JOptionPane.showOptionDialog(null,
                        String.format(BUNDLE.getString("Settings.movie.datasource.remove.info"), path),
                        BUNDLE.getString("Settings.datasource.remove"), JOptionPane.YES_NO_OPTION,
                        JOptionPane.PLAIN_MESSAGE, null, choices, BUNDLE.getString("Button.abort")); //$NON-NLS-1$
                if (decision == 0) {
                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                    MovieModuleManager.MOVIE_SETTINGS.removeMovieDataSources(path);
                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                }
            }
        }
    });
    panelMovieSourcesButtons.add(btnRemove, "1, 3, fill, top");

    JScrollPane scrollPaneIgnore = new JScrollPane();
    panelMovieDataSources.add(scrollPaneIgnore, "12, 4, fill, fill");

    listIgnore = new JList<>();
    scrollPaneIgnore.setViewportView(listIgnore);

    JPanel panelIgnoreButtons = new JPanel();
    panelMovieDataSources.add(panelIgnoreButtons, "14, 4, fill, fill");
    panelIgnoreButtons.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, }, new RowSpec[] {
            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, }));

    JButton btnAddIgnore = new JButton(IconManager.LIST_ADD);
    btnAddIgnore.setToolTipText(BUNDLE.getString("Settings.addignore")); //$NON-NLS-1$
    btnAddIgnore.setMargin(new Insets(2, 2, 2, 2));
    btnAddIgnore.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Path file = TmmUIHelper.selectDirectory(BUNDLE.getString("Settings.ignore")); //$NON-NLS-1$
            if (file != null && Files.isDirectory(file)) {
                settings.addMovieSkipFolder(file.toAbsolutePath().toString());
            }
        }
    });
    panelIgnoreButtons.add(btnAddIgnore, "1, 1");

    JButton btnRemoveIgnore = new JButton(IconManager.LIST_REMOVE);
    btnRemoveIgnore.setToolTipText(BUNDLE.getString("Settings.removeignore")); //$NON-NLS-1$
    btnRemoveIgnore.setMargin(new Insets(2, 2, 2, 2));
    btnRemoveIgnore.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int row = listIgnore.getSelectedIndex();
            if (row != -1) { // nothing selected
                String ingore = settings.getMovieSkipFolders().get(row);
                settings.removeMovieSkipFolder(ingore);
            }
        }
    });
    panelIgnoreButtons.add(btnRemoveIgnore, "1, 3");

    JPanel panel = new JPanel();
    panelMovieDataSources.add(panel, "2, 8, 13, 1, fill, fill");
    panel.setLayout(new FormLayout(
            new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("20dlu"),
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),
                    FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, },
            new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, }));

    JLabel lblNfoFormat = new JLabel(BUNDLE.getString("Settings.nfoFormat"));
    panel.add(lblNfoFormat, "1, 1, right, default");

    cbNfoFormat = new JComboBox(MovieConnectors.values());
    panel.add(cbNfoFormat, "3, 1, fill, default");

    JLabel lblNfoFileNaming = new JLabel(BUNDLE.getString("Settings.nofFileNaming")); //$NON-NLS-1$
    panel.add(lblNfoFileNaming, "7, 1, right, default");

    cbMovieNfoFilename1 = new JCheckBox(BUNDLE.getString("Settings.moviefilename") + ".nfo"); //$NON-NLS-1$
    panel.add(cbMovieNfoFilename1, "9, 1");

    cbMovieNfoFilename2 = new JCheckBox("movie.nfo");
    panel.add(cbMovieNfoFilename2, "9, 2");
    cbMovieNfoFilename2.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            checkChanges();
        }
    });

    cbMovieNfoFilename3 = new JCheckBox(BUNDLE.getString("Settings.nfo.discstyle")); //$NON-NLS-1$
    panel.add(cbMovieNfoFilename3, "9, 3");
    cbMovieNfoFilename3.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            checkChanges();
        }
    });

    final JLabel lblCertificationStyle = new JLabel(BUNDLE.getString("Settings.certificationformat")); //$NON-NLS-1$
    panel.add(lblCertificationStyle, "1, 5, right, default");

    cbCertificationStyle = new JComboBox();
    panel.add(cbCertificationStyle, "3, 5, 7, 1, fill, default");

    JPanel panelBadWords = new JPanel();
    panelBadWords.setBorder(new TitledBorder(null, BUNDLE.getString("Settings.movie.badwords"), //$NON-NLS-1$
            TitledBorder.LEADING, TitledBorder.TOP, null, null));
    add(panelBadWords, "4, 2, fill, fill");
    panelBadWords.setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("50px:grow"),
                    FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, },
            new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"),
                    FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, }));

    JTextPane txtpntBadWordsHint = new JTextPane();
    txtpntBadWordsHint.setBackground(UIManager.getColor("Panel.background"));
    txtpntBadWordsHint.setText(BUNDLE.getString("Settings.movie.badwords.hint")); //$NON-NLS-1$
    TmmFontHelper.changeFont(txtpntBadWordsHint, 0.833);
    panelBadWords.add(txtpntBadWordsHint, "2, 2, 3, 1, fill, default");

    JScrollPane scpBadWords = new JScrollPane();
    panelBadWords.add(scpBadWords, "2, 4, fill, fill");

    listBadWords = new JList<>();
    scpBadWords.setViewportView(listBadWords);

    JButton btnRemoveBadWord = new JButton(IconManager.LIST_REMOVE);
    btnRemoveBadWord.setToolTipText(BUNDLE.getString("Button.remove")); //$NON-NLS-1$
    btnRemoveBadWord.setMargin(new Insets(2, 2, 2, 2));
    btnRemoveBadWord.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            int row = listBadWords.getSelectedIndex();
            if (row != -1) {
                String badWord = MovieModuleManager.MOVIE_SETTINGS.getBadWords().get(row);
                MovieModuleManager.MOVIE_SETTINGS.removeBadWord(badWord);
            }
        }
    });
    panelBadWords.add(btnRemoveBadWord, "4, 4, default, bottom");

    tfAddBadword = new JTextField();
    tfAddBadword.setColumns(10);
    panelBadWords.add(tfAddBadword, "2, 6, fill, default");

    JButton btnAddBadWord = new JButton(IconManager.LIST_ADD);
    btnAddBadWord.setToolTipText(BUNDLE.getString("Button.add")); //$NON-NLS-1$
    btnAddBadWord.setMargin(new Insets(2, 2, 2, 2));
    btnAddBadWord.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (StringUtils.isNotEmpty(tfAddBadword.getText())) {
                MovieModuleManager.MOVIE_SETTINGS.addBadWord(tfAddBadword.getText());
                tfAddBadword.setText("");
            }
        }
    });
    panelBadWords.add(btnAddBadWord, "4, 6");

    initDataBindings();

    {
        // NFO filenames
        List<MovieNfoNaming> movieNfoFilenames = settings.getMovieNfoFilenames();
        if (movieNfoFilenames.contains(MovieNfoNaming.FILENAME_NFO)) {
            cbMovieNfoFilename1.setSelected(true);
        }
        if (movieNfoFilenames.contains(MovieNfoNaming.MOVIE_NFO)) {
            cbMovieNfoFilename2.setSelected(true);
        }
        if (movieNfoFilenames.contains(MovieNfoNaming.DISC_NFO)) {
            cbMovieNfoFilename3.setSelected(true);
        }

        if (!Globals.isDonator()) {
            chckbxTraktTv.setSelected(false);
            chckbxTraktTv.setEnabled(false);
            btnClearTraktTvMovies.setEnabled(false);
        }

        // set default certification style
        cbNfoFormat.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (cbNfoFormat.getSelectedItem() == MovieConnectors.MP) {
                    for (int i = 0; i < cbCertificationStyle.getItemCount(); i++) {
                        CertificationStyleWrapper wrapper = cbCertificationStyle.getItemAt(i);
                        if (wrapper.style == CertificationStyle.TECHNICAL) {
                            cbCertificationStyle.setSelectedItem(wrapper);
                            break;
                        }
                    }
                } else if (cbNfoFormat.getSelectedItem() == MovieConnectors.XBMC
                        || cbNfoFormat.getSelectedItem() == MovieConnectors.KODI) {
                    for (int i = 0; i < cbCertificationStyle.getItemCount(); i++) {
                        CertificationStyleWrapper wrapper = cbCertificationStyle.getItemAt(i);
                        if (wrapper.style == CertificationStyle.LARGE) {
                            cbCertificationStyle.setSelectedItem(wrapper);
                            break;
                        }
                    }
                }
            }
        });

        // certification examples
        for (CertificationStyle style : CertificationStyle.values()) {
            CertificationStyleWrapper wrapper = new CertificationStyleWrapper();
            wrapper.style = style;
            cbCertificationStyle.addItem(wrapper);
            if (style == settings.getMovieCertificationStyle()) {
                cbCertificationStyle.setSelectedItem(wrapper);
            }
        }

        cbCertificationStyle.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                checkChanges();
            }
        });

        // item listener
        cbMovieNfoFilename1.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                checkChanges();
            }
        });
    }

}

From source file:org.openmicroscopy.shoola.agents.imviewer.util.saver.ImgSaver.java

/** Brings up a preview of the image or images to save. */
void previewImage() {
    ImgSaverPreviewer preview = new ImgSaverPreviewer(this);
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    createImages(uiDelegate.getSavingType());
    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    preview.initialize();/*w  w  w  .  j a v  a2 s  .  com*/
    UIUtilities.centerAndShow(preview);
}

From source file:au.org.ala.delta.editor.ui.CharacterTree.java

public void collapseAll() {
    try {/*from  www . ja va2  s  . c  o  m*/
        setCursor(new Cursor(Cursor.WAIT_CURSOR));
        for (int i = 0; i < getRowCount(); i++) {
            collapseRow(i);
        }
    } finally {
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
}

From source file:e3fraud.gui.MainWindow.java

public void actionPerformed(ActionEvent e) {

    //Handle open button action.
    if (e.getSource() == openButton) {
        int returnVal = fc.showOpenDialog(MainWindow.this);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
            //parse file
            this.baseModel = FileParser.parseFile(file);
            log.append(currentTime.currentTime() + " Opened: " + file.getName() + "." + newline);
        } else {/*from  w w  w  .  j av  a  2 s  .  c o m*/
            log.append(currentTime.currentTime() + " Open command cancelled by user." + newline);
        }
        log.setCaretPosition(log.getDocument().getLength());

        //handle Generate button
    } else if (e.getSource() == generateButton) {
        if (this.baseModel != null) {
            //have the user indicate the ToA via pop-up
            JFrame frame1 = new JFrame("Select Target of Assessment");
            Map<String, Resource> actorsMap = this.baseModel.getActorsMap();
            String selectedActorString = (String) JOptionPane.showInputDialog(frame1,
                    "Which actor's perspective are you taking?", "Choose main actor",
                    JOptionPane.QUESTION_MESSAGE, null, actorsMap.keySet().toArray(),
                    actorsMap.keySet().toArray()[0]);
            if (selectedActorString == null) {
                log.append(currentTime.currentTime() + " Attack generation cancelled!" + newline);
            } else {
                lastSelectedActorString = selectedActorString;
                //have the user select a need via pop-up
                JFrame frame2 = new JFrame("Select graph parameter");
                Map<String, Resource> needsMap = this.baseModel.getNeedsMap();
                String selectedNeedString = (String) JOptionPane.showInputDialog(frame2,
                        "What do you want to use as parameter?", "Choose need to parametrize",
                        JOptionPane.QUESTION_MESSAGE, null, needsMap.keySet().toArray(),
                        needsMap.keySet().toArray()[0]);
                if (selectedNeedString == null) {
                    log.append("Attack generation cancelled!" + newline);
                } else {
                    lastSelectedNeedString = selectedNeedString;
                    //have the user select occurence interval via pop-up
                    JTextField xField = new JTextField("1", 4);
                    JTextField yField = new JTextField("500", 4);
                    JPanel myPanel = new JPanel();
                    myPanel.add(new JLabel("Mininum occurences:"));
                    myPanel.add(xField);
                    myPanel.add(Box.createHorizontalStrut(15)); // a spacer
                    myPanel.add(new JLabel("Maximum occurences:"));
                    myPanel.add(yField);
                    int result = JOptionPane.showConfirmDialog(null, myPanel,
                            "Please Enter occurence rate interval", JOptionPane.OK_CANCEL_OPTION);

                    if (result == JOptionPane.CANCEL_OPTION) {
                        log.append("Attack generation cancelled!" + newline);
                    } else if (result == JOptionPane.OK_OPTION) {
                        startValue = Integer.parseInt(xField.getText());
                        endValue = Integer.parseInt(yField.getText());

                        selectedNeed = needsMap.get(selectedNeedString);
                        selectedActor = actorsMap.get(selectedActorString);

                        //Have a Worker thread to the time-consuming generation and raking (to not freeze the GUI)
                        GenerationWorker generationWorker = new GenerationWorker(baseModel, selectedActorString,
                                selectedActor, selectedNeed, selectedNeedString, startValue, endValue, log,
                                lossButton, gainButton, lossGainButton, gainLossButton, groupingButton,
                                collusionsButton) {
                            //make it so that when Worker is done
                            @Override
                            protected void done() {
                                try {
                                    progressBar.setVisible(false);
                                    System.err.println("I made it invisible");
                                    //the Worker's result is retrieved
                                    treeModel.setRoot(get());
                                    tree.setModel(treeModel);

                                    tree.updateUI();
                                    tree.collapseRow(1);
                                    //tree.expandRow(0);
                                    tree.setRootVisible(false);
                                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                                } catch (InterruptedException | ExecutionException ex) {
                                    Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
                                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                                    log.append("Out of memory; please increase heap size of JVM");
                                    PopUps.infoBox(
                                            "Encountered an error. Most likely out of memory; try increasing the heap size of JVM",
                                            "Error");
                                }
                            }
                        };
                        this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                        progressBar.setVisible(true);
                        progressBar.setIndeterminate(true);
                        progressBar.setString("generating...");
                        generationWorker.addPropertyChangeListener(new PropertyChangeListener() {
                            public void propertyChange(PropertyChangeEvent evt) {
                                if ("phase".equals(evt.getPropertyName())) {
                                    progressBar.setMaximum(100);
                                    progressBar.setIndeterminate(false);
                                    progressBar.setString("ranking...");
                                } else if ("progress".equals(evt.getPropertyName())) {
                                    progressBar.setValue((Integer) evt.getNewValue());
                                }
                            }
                        });
                        generationWorker.execute();
                    }
                }
            }
        } else {
            log.append("Load a model file first!" + newline);
        }
    } //handle the refresh button
    else if (e.getSource() == refreshButton) {
        if (lastSelectedNeedString != null && lastSelectedActorString != null) {
            Map<String, Resource> actorsMap = this.baseModel.getActorsMap();
            Map<String, Resource> needsMap = this.baseModel.getNeedsMap();
            selectedNeed = needsMap.get(lastSelectedNeedString);
            selectedActor = actorsMap.get(lastSelectedActorString);

            //Have a Worker thread to the time-consuming generation and raking (to not freeze the GUI)
            GenerationWorker generationWorker = new GenerationWorker(baseModel, lastSelectedActorString,
                    selectedActor, selectedNeed, lastSelectedNeedString, startValue, endValue, log, lossButton,
                    gainButton, lossGainButton, gainLossButton, groupingButton, collusionsButton) {
                //make it so that when Worker is done
                @Override
                protected void done() {
                    try {
                        progressBar.setVisible(false);
                        //the Worker's result is retrieved
                        treeModel.setRoot(get());
                        tree.setModel(treeModel);
                        tree.updateUI();
                        tree.collapseRow(1);
                        //tree.expandRow(0);
                        tree.setRootVisible(false);
                        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                    } catch (InterruptedException | ExecutionException ex) {
                        Logger.getLogger(MainWindow.class.getName()).log(Level.SEVERE, null, ex);
                        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                        log.append("Most likely out of memory; please increase heap size of JVM");
                        PopUps.infoBox(
                                "Encountered an error. Most likely out of memory; try increasing the heap size of JVM",
                                "Error");
                    }
                }
            };
            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            progressBar.setVisible(true);
            progressBar.setIndeterminate(true);
            progressBar.setString("generating...");
            generationWorker.addPropertyChangeListener(new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent evt) {
                    if ("phase".equals(evt.getPropertyName())) {
                        progressBar.setMaximum(100);
                        progressBar.setIndeterminate(false);
                        progressBar.setString("ranking...");
                    } else if ("progress".equals(evt.getPropertyName())) {
                        progressBar.setValue((Integer) evt.getNewValue());
                    }
                }
            });
            generationWorker.execute();

        } else {
            log.append(currentTime.currentTime() + " Nothing to refresh. Generate models first" + newline);
        }

    } //handle show ideal graph button
    else if (e.getSource() == idealGraphButton) {
        if (this.baseModel != null) {
            graph1 = GraphingTool.generateGraph(baseModel, selectedNeed, startValue, endValue, true);//expected graph 
            ChartFrame chartframe1 = new ChartFrame("Ideal results", graph1);
            chartframe1.setPreferredSize(new Dimension(CHART_WIDTH, CHART_HEIGHT));
            chartframe1.pack();
            chartframe1.setLocationByPlatform(true);
            chartframe1.setVisible(true);
        } else {
            log.append(currentTime.currentTime() + " Load a model file first!" + newline);
        }
    } //Handle the graph extend button//Handle the graph extend button
    else if (e.getSource() == expandButton) {
        //make sure there is a graph to show
        if (graph2 == null) {
            log.append(currentTime.currentTime() + " No graph to display. Select one first." + newline);
        } else {
            //this makes sure both graphs have the same y axis:
            //            double lowerBound = min(graph1.getXYPlot().getRangeAxis().getRange().getLowerBound(), graph2.getXYPlot().getRangeAxis().getRange().getLowerBound());
            //            double upperBound = max(graph1.getXYPlot().getRangeAxis().getRange().getUpperBound(), graph2.getXYPlot().getRangeAxis().getRange().getUpperBound());
            //            graph1.getXYPlot().getRangeAxis().setRange(lowerBound, upperBound);
            //            graph2.getXYPlot().getRangeAxis().setRange(lowerBound, upperBound);
            chartPane.removeAll();
            chartPanel = new ChartPanel(graph2);
            chartPanel.setPreferredSize(new Dimension(CHART_WIDTH, CHART_HEIGHT));
            chartPane.add(chartPanel);
            chartPane.add(collapseButton);
            extended = true;
            this.setPreferredSize(new Dimension(this.getWidth() + CHART_WIDTH, this.getHeight()));
            JFrame frame = (JFrame) getRootPane().getParent();
            frame.pack();
        }
    } //Handle the graph collapse button//Handle the graph collapse button
    else if (e.getSource() == collapseButton) {
        System.out.println("resizing by -" + CHART_WIDTH);
        chartPane.removeAll();
        chartPane.add(expandButton);
        this.setPreferredSize(new Dimension(this.getWidth() - CHART_WIDTH, this.getHeight()));
        chartPane.repaint();
        chartPane.revalidate();
        extended = false;
        JFrame frame = (JFrame) getRootPane().getParent();
        frame.pack();
    }
}

From source file:org.yccheok.jstock.gui.portfolio.DividendSummaryJDialog.java

private void jLabel2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel2MouseEntered
    if (this.dividendSummary == null || this.dividendSummary.getTotal() <= 0.0) {
        this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    } else {//from  w  w w.j  ava 2s . co  m
        this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
}

From source file:VASSAL.launch.ModuleManagerWindow.java

public void setWaitCursor(boolean wait) {
    setCursor(Cursor.getPredefinedCursor(wait ? Cursor.WAIT_CURSOR : Cursor.DEFAULT_CURSOR));
}

From source file:org.sleuthkit.autopsy.casemodule.Case.java

/**
 * Updates the current case to the given case and fires off the appropriate
 * property-change/*from   w ww.ja  v  a  2s.c o m*/
 *
 * @param newCase the new current case or null if case is being closed
 *
 */
private static void changeCase(Case newCase) {
    // close the existing case
    Case oldCase = Case.currentCase;
    Case.currentCase = null;
    if (oldCase != null) {
        SwingUtilities.invokeLater(() -> {
            WindowManager.getDefault().getMainWindow()
                    .setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        });
        IngestManager.getInstance().cancelAllIngestJobs();
        doCaseChange(null); //closes windows, etc   
        if (null != oldCase.tskErrorReporter) {
            oldCase.tskErrorReporter.shutdown(); // stop listening for TSK errors for the old case
            oldCase.tskErrorReporter = null;
        }
        eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), oldCase, null));
        if (CaseType.MULTI_USER_CASE == oldCase.getCaseType()) {
            if (null != oldCase.collaborationMonitor) {
                oldCase.collaborationMonitor.shutdown();
            }
            eventPublisher.closeRemoteEventChannel();
        }
    }

    if (newCase != null) {
        currentCase = newCase;
        Logger.setLogDirectory(currentCase.getLogDirectoryPath());
        // sanity check
        if (null != currentCase.tskErrorReporter) {
            currentCase.tskErrorReporter.shutdown();
        }
        // start listening for TSK errors for the new case
        currentCase.tskErrorReporter = new IntervalErrorReportData(currentCase,
                MIN_SECONDS_BETWEEN_ERROR_REPORTS,
                NbBundle.getMessage(Case.class, "IntervalErrorReport.ErrorText"));
        doCaseChange(currentCase);
        SwingUtilities.invokeLater(() -> {
            RecentCases.getInstance().addRecentCase(currentCase.name, currentCase.configFilePath); // update the recent cases
        });
        if (CaseType.MULTI_USER_CASE == newCase.getCaseType()) {
            try {
                /**
                 * Use the text index name as the remote event channel name
                 * prefix since it is unique, the same as the case database
                 * name for a multiuser case, and is readily available
                 * through the Case.getTextIndexName() API.
                 */
                eventPublisher
                        .openRemoteEventChannel(String.format(EVENT_CHANNEL_NAME, newCase.getTextIndexName()));
                currentCase.collaborationMonitor = new CollaborationMonitor();
            } catch (AutopsyEventException | CollaborationMonitor.CollaborationMonitorException ex) {
                logger.log(Level.SEVERE, "Failed to setup for collaboration", ex);
                MessageNotifyUtil.Notify.error(
                        NbBundle.getMessage(Case.class, "Case.CollaborationSetup.FailNotify.Title"),
                        NbBundle.getMessage(Case.class, "Case.CollaborationSetup.FailNotify.ErrMsg"));
            }
        }
        eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), null, currentCase));

    } else {
        Logger.setLogDirectory(PlatformUtil.getLogDirectory());
    }
    SwingUtilities.invokeLater(() -> {
        WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    });
}