Example usage for javax.swing SwingConstants CENTER

List of usage examples for javax.swing SwingConstants CENTER

Introduction

In this page you can find the example usage for javax.swing SwingConstants CENTER.

Prototype

int CENTER

To view the source code for javax.swing SwingConstants CENTER.

Click Source Link

Document

The central position in an area.

Usage

From source file:app.RunApp.java

/**
 * Initializes Chi and Phi tables/*from  w w  w.  j a va2s.  c om*/
 */
private void initChiPhiJTable() {
    fixedTableChiPhi.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    jTableChiPhi.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    fixedTableChiPhi.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jTableChiPhi.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    fixedTableCoocurrences.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    jTableCoocurrences.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    fixedTableCoocurrences.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jTableCoocurrences.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    fixedTableHeatmap.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    jTableHeatmap.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    fixedTableHeatmap.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jTableHeatmap.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    chiLabel = new JLabel("Chi coefficients", SwingConstants.CENTER);
    chiLabel.setBounds(25, 420, 120, 20);
    chiLabel.setBackground(Color.white);
    chiLabel.setForeground(Color.black);
    chiLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
    chiLabel.setOpaque(true);
    chiLabel.setToolTipText("White cells corresponds to chi coefficients");

    panelChiPhi.add(chiLabel);

    phiLabel = new JLabel("Phi coefficients", SwingConstants.CENTER);
    phiLabel.setBounds(165, 420, 120, 20);
    phiLabel.setBackground(Color.lightGray);
    phiLabel.setForeground(Color.black);
    phiLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
    phiLabel.setOpaque(true);
    phiLabel.setToolTipText("Light gray cells corresponds to phi coefficients");

    panelChiPhi.add(phiLabel);

    jLabelChiFiText.setVisible(false);
}

From source file:edu.harvard.i2b2.query.ui.QueryTopPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 *//* w  ww .  ja  va2s  .c o m*/
private void initComponents() {
    jNameLabel = new javax.swing.JLabel();
    jSetSizeLabel = new javax.swing.JLabel();
    jNameTextField = new javax.swing.JTextField();
    jSetSizeFiled = new javax.swing.JLabel();
    jDeleteButton = new javax.swing.JButton();
    jScrollPane1 = new QueryConceptTreePanel("Group 1", this);
    jRunQueryButton = new javax.swing.JButton();
    jCancelButton = new javax.swing.JButton();
    jClearGroupsButton = new javax.swing.JButton();
    jScrollPane2 = new QueryConceptTreePanel("Group 2", this);
    jScrollPane3 = new QueryConceptTreePanel("Group 3", this);
    jScrollPane4 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    // jVisitComboBox = new javax.swing.JComboBox();
    jAndOrLabel1 = new javax.swing.JLabel();
    jAndOrLabel2 = new javax.swing.JLabel();
    jMorePanelsButton = new javax.swing.JButton();
    jWorkflowToolBar = new javax.swing.JToolBar();
    jTimelineToggleButton = new javax.swing.JToggleButton();
    jPatientCountToggleButton = new javax.swing.JToggleButton();
    jPatientSetToggleButton = new javax.swing.JToggleButton();
    jToolbarPanel = new javax.swing.JPanel();
    jQueryNamePanel = new javax.swing.JPanel();

    jOptionsScrollPane = new javax.swing.JScrollPane();
    jOptionsPanel = new javax.swing.JPanel();
    jShowTimelineCheckBox = new javax.swing.JCheckBox();
    jGetPatientCountCheckBox = new javax.swing.JCheckBox();
    jGetPatientSetCheckBox = new javax.swing.JCheckBox();

    setLayout(null);

    // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
    // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jPanel1.setLayout(null);

    jPanel1.add(jScrollPane1);
    jScrollPane1.setBounds(0, 0, 180, 200);

    jPanel1.add(jScrollPane2);
    jScrollPane2.setBounds(185, 0, 180, 200);

    jPanel1.add(jScrollPane3);
    jScrollPane3.setBounds(370, 0, 180, 200);

    //jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    jAndOrLabel1.setText("and");
    //jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel1);
    // jAndOrLabel1.setBounds(190, 90, 30, 18);

    //jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    // jAndOrLabel2.setText("and");
    //jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel2);
    // jAndOrLabel2.setBounds(410, 90, 30, 18);

    jQueryNamePanel.setLayout(null);
    jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jNameLabel.setText(" Query Name: ");
    jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setBounds(2, 2, 70, 23);
    add(jNameLabel);
    // jQueryNamePanel.add(jNameLabel);
    jNameLabel.setTransferHandler(new NameLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });

    jNameTextField.setText("");
    jNameTextField.setBounds(95, 10, 400, 20);
    jNameTextField.setEditable(false);
    jNameTextField.setDragEnabled(true);
    jNameTextField.setTransferHandler(new TransferHandler("Text"));
    // jQueryNamePanel.add(jNameTextField);
    // add(jNameTextField);
    // add(jQueryNamePanel);
    // jQueryNamePanel.setBounds(5, 5, 400, 50);

    jClearGroupsButton.setText("Reset Groups");
    jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearGroupsButtonActionPerformed(evt);
        }
    });
    jClearGroupsButton.setBounds(600, 10, 115, 20);
    add(jClearGroupsButton);

    jPanel1.setPreferredSize(new Dimension(700, 150));
    jScrollPane4.setViewportView(jPanel1);
    add(jScrollPane4);
    jScrollPane4.setBounds(20, 35, 635, 220);
    jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);

    jCancelButton.setText("Cancel");
    jCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelButtonActionPerformed(evt);
        }
    });
    // add(jCancelButton);
    // jCancelButton.setBounds(20, 255, 90, 23);
    // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10));

    jRunQueryButton.setText("Run Query");
    jRunQueryButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRunQueryButtonActionPerformed(evt);
        }
    });
    add(jRunQueryButton);
    jRunQueryButton.setBounds(100, 255, 625, 23);

    jSetSizeLabel.setText(" Patient(s) returned:");
    add(jSetSizeLabel);
    jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jSetSizeLabel.setBounds(20, 275, 70, 23);

    // jSetSizeFiled.setText(" subjects");
    // jSetSizeFiled.setEditable(false);
    // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT);
    // add(jSetSizeFiled);
    // jSetSizeLabel.setBounds(20, 275, 70, 23);

    jToolbarPanel.setLayout(new java.awt.BorderLayout());

    // jWorkflowToolBar.setRollover(true);
    // jWorkflowToolBar.setInheritsPopupMenu(true);
    jTimelineToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jTimelineToggleButton.setText("Show TimeLine");
    jTimelineToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jTimelineToggleButton);

    jPatientCountToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientCountToggleButton.setText("Get Patient Count");
    jPatientCountToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientCountToggleButton);

    jPatientSetToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientSetToggleButton.setText("Get Patient Set");
    jPatientSetToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientSetToggleButton);
    jWorkflowToolBar.setPreferredSize(new Dimension(380, 40));

    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START);
    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER);

    // add(jToolbarPanel);
    jToolbarPanel.setBounds(20, 130, 240, 23);

    jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group");
    jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMorePanelsButtonActionPerformed(evt);
        }
    });
    // add(jMorePanelsButton);
    // jMorePanelsButton.setBounds(655, 35, 60, 220);

    jPanel1.add(jMorePanelsButton);
    jMorePanelsButton.setBounds(550, 0, 60, 200);

    jOptionsPanel.setLayout(null);
    jOptionsScrollPane.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
    jShowTimelineCheckBox.setText("Timeline");
    jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view");
    jOptionsPanel.add(jShowTimelineCheckBox);
    jShowTimelineCheckBox.setBounds(5, 20, 110, 15);

    jGetPatientCountCheckBox.setText("Patient Count");
    jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jGetPatientCountCheckBox.setToolTipText("Get the patient count XML");
    jOptionsPanel.add(jGetPatientCountCheckBox);
    jGetPatientCountCheckBox.setBounds(5, 50, 110, 15);

    jGetPatientSetCheckBox.setText("Patient Set");
    jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jOptionsPanel.add(jGetPatientSetCheckBox);
    // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15);

    jOptionsScrollPane.setViewportView(jOptionsPanel);

    add(jOptionsScrollPane);
    jOptionsScrollPane.setBounds(500, 30, 120, 190);

    /*
     * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jDeleteButtonActionPerformed(evt); } });
     * 
     * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new
     * String[] { "Groups don't have to occur in the same visit", "Groups
     * must all occur in the same visit" })); add(jVisitComboBox);
     * jVisitComboBox.setBounds(20, 40, 240, 22);
     * 
     * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23);
     * 
     * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320);
     * 
     * jRunQueryButton.setText("Run Query");
     * jRunQueryButton.addActionListener(new java.awt.event.ActionListener()
     * { public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRunQueryButtonActionPerformed(evt); } });
     * 
     * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23);
     * 
     * jCancelButton.setText("Remove All");
     * jCancelButton.addActionListener(new java.awt.event.ActionListener() {
     * public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRemoveAllButtonActionPerformed(evt); } });
     * 
     * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23);
     * 
     * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
     * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
     * jPanel1.setLayout(null);
     * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20);
     * //jPanel1.setVisible(false);
     * 
     * //jScrollPane1.setToolTipText("scrollpane 1");
     * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350);
     * 
     * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);
     */

    jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255));
    jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel1.setText("and");
    jAndOrLabel1.setToolTipText("Click to change the relationship");
    jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel1MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel1);

    jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel2.setText("and");
    jAndOrLabel2.setToolTipText("Click to change the relationship");
    jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel2MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel2);

    /*
     * jPanel1.add(jScrollPane3); jScrollPane3.setBounds(420, 0, 170, 350);
     * 
     * jScrollPane4.setViewportView(jPanel1);
     * 
     * add(jScrollPane4); jScrollPane4.setBounds(20, 70, 594, 370);
     * 
     * jMorePanelsButton.setText("Add Panel");
     * jMorePanelsButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jMorePanelsButtonActionPerformed(evt); } });
     * 
     * add(jMorePanelsButton); jMorePanelsButton.setBounds(215, 10, 90, 23);
     */

    // jTree1.addTreeWillExpandListener(this);
    // jTree1.addTreeExpansionListener(this);
    // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1"));
    // jScrollPane1.setToolTipText("Double click on a folder to view the
    // items inside");
    // jTree2.addTreeExpansionListener(this);
    // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2"));
    // jTree3.addTreeExpansionListener(this);
    // treepanel = new QueryConceptTreePanel("", this);
    // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3"));
    // jSlider1.setMajorTickSpacing(20);
    /*
     * jSlider1.setPaintTicks(true); jSlider1.setValue(0);
     * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on
     * left is more Sensitive Query, " + "on right is more Specific");
     * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18);
     * 
     * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
     * jLabel1.setText("Sensitivity <"); add(jLabel1);
     * jLabel1.setBounds(290, 40, 80, 20);
     * 
     * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel2.setText("> Specificity"); add(jLabel2);
     * jLabel2.setBounds(525, 40, 70, 20);
     */

    dataModel.addPanel(jScrollPane1, null, 0);
    dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0);
    dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555);
}

From source file:com.ln.gui.Main.java

@SuppressWarnings("unchecked")
public Main() {/*  www.jav a2 s.c  o  m*/
    System.gc();
    setIconImage(Toolkit.getDefaultToolkit().getImage(Configuration.mydir + "\\resources\\icons\\ln6464.png"));
    DateFormat dd = new SimpleDateFormat("dd");
    DateFormat dh = new SimpleDateFormat("HH");
    DateFormat dm = new SimpleDateFormat("mm");
    Date day = new Date();
    Date hour = new Date();
    Date minute = new Date();
    dayd = Integer.parseInt(dd.format(day));
    hourh = Integer.parseInt(dh.format(hour));
    minutem = Integer.parseInt(dm.format(minute));
    setTitle("Liquid Notify Revision 2");
    Description.setBackground(Color.WHITE);
    Description.setContentType("text/html");
    Description.setEditable(false);
    Getcalendar.Main();
    HyperlinkListener hyperlinkListener = new ActivatedHyperlinkListener(f, Description);
    Description.addHyperlinkListener(hyperlinkListener);
    //Add components
    setContentPane(contentPane);
    setJMenuBar(menuBar);
    contentPane.setLayout(
            new MigLayout("", "[220px:230.00:220,grow][209.00px:n:5000,grow]", "[22px][][199.00,grow][grow]"));
    eventsbtn.setToolTipText("Displays events currently set to notify");
    eventsbtn.setMinimumSize(new Dimension(220, 23));
    eventsbtn.setMaximumSize(new Dimension(220, 23));
    contentPane.add(eventsbtn, "cell 0 0");
    NewsArea.setBackground(Color.WHITE);
    NewsArea.setBorder(new BevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, Color.LIGHT_GRAY, Color.DARK_GRAY,
            Color.DARK_GRAY));
    NewsArea.setMinimumSize(new Dimension(20, 22));
    NewsArea.setMaximumSize(new Dimension(10000, 22));
    contentPane.add(NewsArea, "cell 1 0,growx,aligny top");
    menuBar.add(File);
    JMenuItem Settings = new JMenuItem("Settings");
    Settings.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\settings.png"));
    Settings.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            Settings setup = new Settings();
            setup.setVisible(true);
            setup.setLocationRelativeTo(rootPane);
        }
    });
    File.add(Settings);
    File.add(mntmNewMenuItem);
    Tray.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\ln1616.png"));
    File.add(Tray);
    Exit.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\exit.png"));
    File.add(Exit);

    menuBar.add(mnNewMenu);

    Update.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\update.png"));
    Update.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            try {
                URL localURL = new URL("http://jiiks.net23.net/tlnotify/online.html");
                URLConnection localURLConnection = localURL.openConnection();
                BufferedReader localBufferedReader = new BufferedReader(
                        new InputStreamReader(localURLConnection.getInputStream()));
                String str = localBufferedReader.readLine();
                if (!str.contains("YES")) {
                    String st2221 = "Updates server appears to be offline";
                    JOptionPane pane1 = new JOptionPane(st2221, JOptionPane.WARNING_MESSAGE,
                            JOptionPane.DEFAULT_OPTION);
                    JDialog dialog1 = pane1.createDialog("Update");
                    dialog1.setLocationRelativeTo(null);
                    dialog1.setVisible(true);
                    dialog1.setAlwaysOnTop(true);
                } else if (str.contains("YES")) {
                    URL localURL2 = new URL("http://jiiks.net23.net/tlnotify/latestversion.html");
                    URLConnection localURLConnection1 = localURL2.openConnection();
                    BufferedReader localBufferedReader2 = new BufferedReader(
                            new InputStreamReader(localURLConnection1.getInputStream()));
                    String str2 = localBufferedReader2.readLine();
                    Updatechecker.latestver = str2;
                    if (Integer.parseInt(str2) <= Configuration.version) {
                        String st2221 = "No updates available =(";
                        JOptionPane pane1 = new JOptionPane(st2221, JOptionPane.WARNING_MESSAGE,
                                JOptionPane.DEFAULT_OPTION);
                        JDialog dialog1 = pane1.createDialog("Update");
                        dialog1.setLocationRelativeTo(null);
                        dialog1.setVisible(true);
                        dialog1.setAlwaysOnTop(true);
                    } else if (Integer.parseInt(str2) > Configuration.version) {
                        String st2221 = "Updates available!";
                        JOptionPane pane1 = new JOptionPane(st2221, JOptionPane.WARNING_MESSAGE,
                                JOptionPane.DEFAULT_OPTION);
                        JDialog dialog1 = pane1.createDialog("Update");
                        dialog1.setLocationRelativeTo(null);
                        dialog1.setVisible(true);
                        dialog1.setAlwaysOnTop(true);

                        Updatechecker upd = new Updatechecker();
                        upd.setVisible(true);
                        upd.setLocationRelativeTo(rootPane);
                        upd.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                    }
                }
            } catch (MalformedURLException e1) {
                e1.printStackTrace();
            } catch (IOException e1) {
                e1.printStackTrace();
            }

        }

    });
    mnNewMenu.add(Update);
    JMenuItem About = new JMenuItem("About");
    About.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\about.png"));
    About.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            About a = new About();
            a.setVisible(true);
            a.setLocationRelativeTo(rootPane);
            a.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        }
    });
    mnNewMenu.add(About);
    JMenuItem Github = new JMenuItem("Github");
    Github.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\github.png"));
    Github.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String url = "https://github.com/Jiiks/Liquid-Notify-Rev2";
            try {
                java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
    });
    mnNewMenu.add(Github);
    JMenuItem Thread = new JMenuItem("Thread");
    Thread.setIcon(new ImageIcon(Configuration.mydir + "\\resources\\icons\\liquid.png"));
    Thread.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String url = "http://www.teamliquid.net/forum/viewmessage.php?topic_id=318184";
            try {
                java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
            } catch (IOException e1) {
                e1.printStackTrace();
            }
        }
    });
    mnNewMenu.add(Thread);
    Refreshbtn.setToolTipText("Refreshes calendar, please don't spam ^_^");
    Refreshbtn.setPreferredSize(new Dimension(90, 20));
    Refreshbtn.setMinimumSize(new Dimension(100, 20));
    Refreshbtn.setMaximumSize(new Dimension(100, 20));
    contentPane.add(Refreshbtn, "flowx,cell 0 1,alignx left");
    //Components to secondary panel   
    Titlebox = new JComboBox();
    contentPane.add(Titlebox, "cell 1 1,growx,aligny top");
    Titlebox.setMinimumSize(new Dimension(20, 20));
    Titlebox.setMaximumSize(new Dimension(10000, 20));
    //Set other
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 686, 342);
    contentPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    NewsArea.setEnabled(false);
    NewsArea.setEditable(false);
    NewsArea.setText("News: " + News);
    contentPane.add(panel, "cell 0 2,grow");
    panel.setLayout(null);
    final JCalendar calendar = new JCalendar();
    calendar.getMonthChooser().setPreferredSize(new Dimension(120, 20));
    calendar.getMonthChooser().setMinimumSize(new Dimension(120, 24));
    calendar.getYearChooser().setLocation(new Point(20, 0));
    calendar.getYearChooser().setMaximum(100);
    calendar.getYearChooser().setMaximumSize(new Dimension(100, 2147483647));
    calendar.getYearChooser().setMinimumSize(new Dimension(50, 20));
    calendar.getYearChooser().setPreferredSize(new Dimension(50, 20));
    calendar.getYearChooser().getSpinner().setPreferredSize(new Dimension(100, 20));
    calendar.getYearChooser().getSpinner().setMinimumSize(new Dimension(100, 20));
    calendar.getMonthChooser().getSpinner().setPreferredSize(new Dimension(119, 20));
    calendar.getMonthChooser().getSpinner().setMinimumSize(new Dimension(120, 24));
    calendar.getDayChooser().getDayPanel().setFont(new Font("Tahoma", Font.PLAIN, 11));
    calendar.setDecorationBordersVisible(true);
    calendar.setTodayButtonVisible(true);
    calendar.setBackground(Color.LIGHT_GRAY);
    calendar.setBounds(0, 0, 220, 199);
    calendar.getDate();
    calendar.setWeekOfYearVisible(false);
    calendar.setDecorationBackgroundVisible(false);
    calendar.setMaxDayCharacters(2);
    calendar.getDayChooser().setFont(new Font("Tahoma", Font.PLAIN, 10));
    panel.add(calendar);
    Descriptionscrollpane.setLocation(new Point(100, 100));
    Descriptionscrollpane.setMaximumSize(new Dimension(10000, 10000));
    Descriptionscrollpane.setMinimumSize(new Dimension(20, 200));
    Description.setLocation(new Point(100, 100));
    Description.setBorder(new BevelBorder(BevelBorder.LOWERED, Color.LIGHT_GRAY, Color.LIGHT_GRAY,
            Color.DARK_GRAY, Color.DARK_GRAY));
    Description.setMaximumSize(new Dimension(1000, 400));
    Description.setMinimumSize(new Dimension(400, 200));
    contentPane.add(Descriptionscrollpane, "cell 1 2 1 2,growx,aligny top");
    Descriptionscrollpane.setViewportView(Description);
    verticalStrut.setMinimumSize(new Dimension(12, 20));
    contentPane.add(verticalStrut, "cell 0 1");
    Notify.setToolTipText("Adds selected event to notify event list.");
    Notify.setHorizontalTextPosition(SwingConstants.CENTER);
    Notify.setPreferredSize(new Dimension(100, 20));
    Notify.setMinimumSize(new Dimension(100, 20));
    Notify.setMaximumSize(new Dimension(100, 20));
    contentPane.add(Notify, "cell 0 1,alignx right");
    calendar.getMonthChooser().addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            month = calendar.getMonthChooser().getMonth();
            Parser.parse();
        }
    });

    calendar.getDayChooser().addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
            try {
                int h = calendar.getMonthChooser().getMonth();
                @SuppressWarnings("deprecation")
                int date = calendar.getDate().getDate();
                int month = calendar.getMonthChooser().getMonth() + 1;
                globmonth = calendar.getMonthChooser().getMonth();
                sdate = date;
                datestring = Integer.toString(sdate);
                monthstring = Integer.toString(month);
                String[] Hours = Betaparser.Hours;
                String[] Titles = Betaparser.STitle;
                String[] Full = new String[Hours.length];
                String[] Minutes = Betaparser.Minutes;
                String[] Des = Betaparser.Description;
                String[] Des2 = new String[Betaparser.Description.length];
                String Seconds = "00";
                String gg;
                int[] IntHours = new int[Hours.length];
                int[] IntMins = new int[Hours.length];
                int Events = 0;
                monthday = monthstring + "|" + datestring + "|";
                Titlebox.removeAllItems();
                for (int a = 0; a != Hours.length; a++) {
                    IntHours[a] = Integer.parseInt(Hours[a]);
                    IntMins[a] = Integer.parseInt(Minutes[a]);
                }
                for (int i1 = 0; i1 != Hours.length; i1++) {
                    if (Betaparser.Events[i1].startsWith(monthday)) {
                        Full[i1] = String.format("%02d:%02d", IntHours[i1], IntMins[i1]) + " | " + Titles[i1];
                        Titlebox.addItem(Full[i1]);
                    }
                }
            } catch (Exception e1) {
                //Catching mainly due to boot property change            
            }
        }
    });
    Image image = Toolkit.getDefaultToolkit().getImage(Configuration.mydir + "\\resources\\icons\\ln1616.png");
    final SystemTray tray = SystemTray.getSystemTray();
    ActionListener listener = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setVisible(true);
        }
    };
    PopupMenu popup = new PopupMenu();
    MenuItem defaultItem = new MenuItem();
    defaultItem.addActionListener(listener);
    TrayIcon trayIcon = null;
    trayIcon = new TrayIcon(image, "LiquidNotify Revision 2", popup);

    trayIcon.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent arg0) {
            setVisible(true);
        }
    });//
    try {
        tray.add(trayIcon);
    } catch (AWTException e) {
        System.err.println(e);
    }
    if (trayIcon != null) {
        trayIcon.setImage(image);
    }

    Tray.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
        }
    });

    Titlebox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            Descparser.parsedesc();
        }
    });

    Refreshbtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            Getcalendar.Main();
            Descparser.parsedesc();
        }
    });

    Notify.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            NOTIFY = Descparser.TTT;
            NOTIFYD = Descparser.DDD;
            NOTIFYH = Descparser.HHH;
            NOTIFYM = Descparser.MMM;
            int i = events;
            NOA[i] = NOTIFY;
            NOD[i] = NOTIFYD;
            NOH[i] = NOTIFYH;
            NOM[i] = NOTIFYM;
            Eventlist[i] = "Starts in: " + Integer.toString(NOD[i]) + " Days " + Integer.toString(NOH[i])
                    + " Hours " + Integer.toString(NOM[i]) + " Minutes " + " | " + NOA[i];
            events = events + 1;
            Notifylist si = new Notifylist();
            si.setVisible(false);
            si.setBounds(1, 1, 1, 1);
            si.dispose();
            if (thread.getState().name().equals("PENDING")) {
                thread.execute();
            }
        }
    });
    eventsbtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            Notifylist list = new Notifylist();
            if (played == 1) {
                asd.close();
                played = 0;
            }
            list.setVisible(true);
            list.setLocationRelativeTo(rootPane);
            list.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        }
    });

    mntmNewMenuItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (thread.getState().name().equals("PENDING")) {
                thread.execute();
            }
            Userstreams us = new Userstreams();
            us.setVisible(true);
            us.setLocationRelativeTo(rootPane);
        }
    });

    Exit.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            //Absolute exit
            JOptionPane.showMessageDialog(rootPane, "Bye bye :(", "Exit", JOptionPane.INFORMATION_MESSAGE);
            Runtime ln = Runtime.getRuntime();
            ln.gc();
            final Frame[] allf = Frame.getFrames();
            final Window[] allw = Window.getWindows();
            for (final Window allwindows : allw) {
                allwindows.dispose();
            }
            for (final Frame allframes : allf) {
                allframes.dispose();
                System.exit(0);
            }
        }
    });
}

From source file:at.nhmwien.schema_mapping_tool.ProcessMappingWindow.java

/** This method is called from within the constructor to
 * initialize the form./*w ww.  j  a  v  a 2  s.c  om*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    progressPanel = new javax.swing.JPanel();
    progressBar = new javax.swing.JProgressBar();
    progressBarLabel = new javax.swing.JLabel();
    abortButton = new javax.swing.JButton();
    processButton = new javax.swing.JButton();
    typeSelectTabbedPanel = new javax.swing.JTabbedPane();
    optionsPanel = new javax.swing.JPanel();
    inputFileFormatLabel = new javax.swing.JLabel();
    outputFileFormatLabel = new javax.swing.JLabel();
    inputFileFormatComboBox = new javax.swing.JComboBox();
    outputFileFormatComboBox = new javax.swing.JComboBox();
    ifEncodingLabel = new javax.swing.JLabel();
    ifEncodingComboBox = new javax.swing.JComboBox();
    ofEncodingLabel = new javax.swing.JLabel();
    ofEncodingComboBox = new javax.swing.JComboBox();
    cooButton = new javax.swing.JButton();
    cioButton = new javax.swing.JButton();
    inputIDPrefixLabel = new javax.swing.JLabel();
    inputIDPrefixTextField = new javax.swing.JTextField();
    countThresholdLabel = new javax.swing.JLabel();
    countThresholdTextField = new javax.swing.JFormattedTextField();
    menuToolBar = new javax.swing.JToolBar();
    loadSettingsButton = new javax.swing.JButton();
    saveSettingsButton = new javax.swing.JButton();

    setTitle("Process Mapping");
    setResizable(false);

    progressPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Mapping Progress",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12),
            new java.awt.Color(1, 1, 1))); // NOI18N

    progressBarLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    progressBarLabel.setText("Progress");

    javax.swing.GroupLayout progressPanelLayout = new javax.swing.GroupLayout(progressPanel);
    progressPanel.setLayout(progressPanelLayout);
    progressPanelLayout.setHorizontalGroup(
            progressPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                    javax.swing.GroupLayout.Alignment.TRAILING,
                    progressPanelLayout.createSequentialGroup().addContainerGap()
                            .addGroup(progressPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(progressBarLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE)
                                    .addComponent(progressBar, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, 657, Short.MAX_VALUE))
                            .addContainerGap()));
    progressPanelLayout.setVerticalGroup(progressPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, progressPanelLayout.createSequentialGroup()
                    .addComponent(progressBarLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    abortButton.setText("Abort");
    abortButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            abortButtonActionPerformed(evt);
        }
    });

    processButton.setText("Process");
    processButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            processButtonActionPerformed(evt);
        }
    });

    optionsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Process Options",
            javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
            javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 1, 12),
            new java.awt.Color(1, 1, 1))); // NOI18N

    inputFileFormatLabel.setText("Input Format:");

    outputFileFormatLabel.setText("Output Format:");

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

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

    ifEncodingLabel.setText("Encoding:");

    ofEncodingLabel.setText("Encoding:");

    cooButton.setText("Output Order");
    cooButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cooButtonActionPerformed(evt);
        }
    });

    cioButton.setText("Input Order");
    cioButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cioButtonActionPerformed(evt);
        }
    });

    inputIDPrefixLabel.setText("Input ID Prefix:");

    countThresholdLabel.setText("New File every X entries:");

    countThresholdTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(
            new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0"))));
    countThresholdTextField.setText("0");

    javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel);
    optionsPanel.setLayout(optionsPanelLayout);
    optionsPanelLayout.setHorizontalGroup(optionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(optionsPanelLayout.createSequentialGroup().addGroup(optionsPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(inputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(outputFileFormatLabel, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE))
                            .addGap(18, 18, 18)
                            .addGroup(optionsPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(optionsPanelLayout.createSequentialGroup()
                                            .addComponent(inputFileFormatComboBox,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(ifEncodingLabel))
                                    .addGroup(optionsPanelLayout.createSequentialGroup()
                                            .addComponent(outputFileFormatComboBox,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(18, 18, 18).addComponent(ofEncodingLabel)))
                            .addGap(18, 18, 18)
                            .addGroup(optionsPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ofEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(cioButton)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 434,
                                    Short.MAX_VALUE)
                            .addComponent(cooButton))
                    .addGroup(optionsPanelLayout.createSequentialGroup().addComponent(inputIDPrefixLabel)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(inputIDPrefixTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 552,
                                    Short.MAX_VALUE))
                    .addGroup(optionsPanelLayout.createSequentialGroup()
                            .addComponent(countThresholdLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 163,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(countThresholdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 65,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    optionsPanelLayout.setVerticalGroup(optionsPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup().addContainerGap().addGroup(optionsPanelLayout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputFileFormatLabel)
                    .addComponent(inputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(ifEncodingLabel)
                    .addComponent(ifEncodingComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(outputFileFormatLabel)
                            .addComponent(outputFileFormatComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(ofEncodingLabel).addComponent(ofEncodingComboBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(optionsPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(inputIDPrefixLabel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(inputIDPrefixTextField))
                    .addGap(18, 18, 18)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(countThresholdLabel).addComponent(countThresholdTextField,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cioButton).addComponent(cooButton))
                    .addContainerGap()));

    menuToolBar.setRollover(true);

    loadSettingsButton.setText("Load");
    loadSettingsButton.setFocusable(false);
    loadSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    loadSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    loadSettingsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            loadSettingsButtonActionPerformed(evt);
        }
    });
    menuToolBar.add(loadSettingsButton);

    saveSettingsButton.setText("Save");
    saveSettingsButton.setFocusable(false);
    saveSettingsButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    saveSettingsButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    saveSettingsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveSettingsButtonActionPerformed(evt);
        }
    });
    menuToolBar.add(saveSettingsButton);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(menuToolBar, javax.swing.GroupLayout.DEFAULT_SIZE, 715, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap().addComponent(typeSelectTabbedPanel,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 703, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap()
                            .addComponent(progressPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addContainerGap())
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(abortButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 541, Short.MAX_VALUE)
                    .addComponent(processButton).addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addComponent(menuToolBar, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(optionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(typeSelectTabbedPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 182,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(progressPanel, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(abortButton).addComponent(processButton))
                    .addContainerGap()));

    pack();
}

From source file:com.openbravo.pos.sales.JRetailTicketPreviewTicket.java

/** This method is called from within the constructor to
 * initialize the form./*  w ww . j a va 2 s.  c o  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    m_jOptions = new javax.swing.JPanel();
    m_jButtons = new javax.swing.JPanel();
    m_jTicketId = new javax.swing.JLabel();
    jButtonSearch = new javax.swing.JButton();
    //    m_jEdit = new javax.swing.JButton();
    m_jRefund = new javax.swing.JButton();
    m_jPrint = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    m_jPanelTicket = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    // m_jKeys = new com.openbravo.editor.JEditorKeys();
    //        jPanel5 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    //        m_jTicketEditor = new com.openbravo.editor.JEditorIntegerPositive();
    jPanel1 = new javax.swing.JPanel();
    //        jrbSales = new javax.swing.JRadioButton();
    //     jrbRefunds = new javax.swing.JRadioButton();

    setLayout(new java.awt.BorderLayout());

    m_jOptions.setLayout(new java.awt.BorderLayout());

    m_jButtons.setPreferredSize(new java.awt.Dimension(506, 56));
    m_jButtons.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    m_jTicketId.setBackground(java.awt.Color.white);
    m_jTicketId.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    m_jTicketId.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory
                    .createLineBorder(javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")),
            javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));
    m_jTicketId.setOpaque(true);
    m_jTicketId.setPreferredSize(new java.awt.Dimension(160, 25));
    m_jTicketId.setRequestFocusEnabled(false);
    m_jButtons.add(m_jTicketId, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 15, -1, 30));

    jButtonSearch.setBackground(new java.awt.Color(255, 255, 255));
    jButtonSearch
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/search.png"))); // NOI18N
    jButtonSearch.setText(AppLocal.getIntString("label.search")); // NOI18N
    jButtonSearch.setFocusPainted(false);
    jButtonSearch.setFocusable(false);
    jButtonSearch.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jButtonSearch.setRequestFocusEnabled(false);
    jButtonSearch.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButtonSearchActionPerformed(evt);
        }
    });
    m_jButtons.add(jButtonSearch, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 12, 85, 35));

    //        m_jEdit.setBackground(new java.awt.Color(255, 255, 255));
    //        m_jEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/edit.png"))); // NOI18N
    //        m_jEdit.setText(AppLocal.getIntString("button.edit")); // NOI18N
    //        m_jEdit.setFocusPainted(false);
    //        m_jEdit.setFocusable(false);
    //        m_jEdit.setMargin(new java.awt.Insets(8, 14, 8, 14));
    //        m_jEdit.setRequestFocusEnabled(false);
    //        m_jEdit.addActionListener(new java.awt.event.ActionListener() {
    //            public void actionPerformed(java.awt.event.ActionEvent evt) {
    //                m_jEditActionPerformed(evt);
    //            }
    //        });
    //        m_jButtons.add(m_jEdit, new org.netbeans.lib.awtextra.AbsoluteConstraints(258, 12, 85, 35));

    //        m_jRefund.setBackground(new java.awt.Color(255, 255, 255));
    //        m_jRefund.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/inbox.png"))); // NOI18N
    //        m_jRefund.setText(AppLocal.getIntString("button.refund")); // NOI18N
    //        m_jRefund.setFocusPainted(false);
    //        m_jRefund.setFocusable(false);
    //        m_jRefund.setMargin(new java.awt.Insets(8, 14, 8, 14));
    //        m_jRefund.setRequestFocusEnabled(false);
    //        m_jRefund.addActionListener(new java.awt.event.ActionListener() {
    //            public void actionPerformed(java.awt.event.ActionEvent evt) {
    //                m_jRefundActionPerformed(evt);
    //            }
    //        });
    //        m_jButtons.add(m_jRefund, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 10, 50, 35));

    m_jPrint.setBackground(new java.awt.Color(255, 255, 255));
    m_jPrint.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/yast_printer.png"))); // NOI18N
    m_jPrint.setText(AppLocal.getIntString("button.print")); // NOI18N
    m_jPrint.setFocusPainted(false);
    m_jPrint.setFocusable(false);
    m_jPrint.setMargin(new java.awt.Insets(0, 0, 0, 0));
    m_jPrint.setRequestFocusEnabled(false);
    m_jPrint.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jPrintActionPerformed(evt);
        }
    });
    m_jButtons.add(m_jPrint, new org.netbeans.lib.awtextra.AbsoluteConstraints(258, 12, 85, 35));

    m_jOptions.add(m_jButtons, java.awt.BorderLayout.WEST);

    jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    m_jOptions.add(jPanel2, java.awt.BorderLayout.CENTER);

    add(m_jOptions, java.awt.BorderLayout.NORTH);

    m_jPanelTicket.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    m_jPanelTicket.setLayout(new java.awt.BorderLayout());
    add(m_jPanelTicket, java.awt.BorderLayout.CENTER);

    jPanel3.setLayout(new java.awt.BorderLayout());

    jPanel4.setPreferredSize(new java.awt.Dimension(175, 276));
    jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.Y_AXIS));

    //        m_jKeys.addActionListener(new java.awt.event.ActionListener() {
    //            public void actionPerformed(java.awt.event.ActionEvent evt) {
    //                m_jKeysActionPerformed(evt);
    //            }
    //        });
    //        jPanel4.add(m_jKeys);

    //  jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    //  jPanel5.setPreferredSize(new java.awt.Dimension(201, 60));
    //  jPanel5.setLayout(new java.awt.GridBagLayout());

    //        jButton1.setBackground(new java.awt.Color(255, 255, 255));
    //        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/button_ok.png"))); // NOI18N
    //        jButton1.setFocusPainted(false);
    //        jButton1.setFocusable(false);
    //        jButton1.setMargin(new java.awt.Insets(8, 14, 8, 14));
    //        jButton1.setRequestFocusEnabled(false);
    //        jButton1.addActionListener(new java.awt.event.ActionListener() {
    //            public void actionPerformed(java.awt.event.ActionEvent evt) {
    //                jButton1ActionPerformed(evt);
    //            }
    //        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
    //        jPanel5.add(jButton1, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    //   jPanel5.add(m_jTicketEditor, gridBagConstraints);

    //  jPanel4.add(jPanel5);

    jPanel3.add(jPanel4, java.awt.BorderLayout.NORTH);

    jPanel1.setPreferredSize(new java.awt.Dimension(130, 25));

    //        buttonGroup1.add(jrbSales);
    //        jrbSales.setText(AppLocal.getIntString("label.sales")); // NOI18N
    //        jrbSales.setFocusPainted(false);
    //        jrbSales.setFocusable(false);
    //        jrbSales.setRequestFocusEnabled(false);
    //        jPanel1.add(jrbSales);

    //        buttonGroup1.add(jrbRefunds);
    //        jrbRefunds.setText(AppLocal.getIntString("label.refunds")); // NOI18N
    //        jrbRefunds.setFocusPainted(false);
    //        jrbRefunds.setFocusable(false);
    //        jrbRefunds.setRequestFocusEnabled(false);
    //        jPanel1.add(jrbRefunds);

    jPanel3.add(jPanel1, java.awt.BorderLayout.CENTER);

    add(jPanel3, java.awt.BorderLayout.EAST);
}

From source file:edu.ku.brc.specify.utilapps.sp5utils.Sp5Forms.java

/**
 * /*  www  .j  a  va  2s.c  om*/
 */
protected void showForm() {
    if (selectedForm != null) {
        if (formFrame != null) {
            formFrame.setVisible(false);
            formFrame.dispose();
        }

        formFrame = new JFrame();

        FormPanelInfo formPanelInfo = createPanel(selectedForm);
        JPanel panel = formPanelInfo.getPanel();

        JLabel label = new JLabel(formPanelInfo.getTitle(), SwingConstants.CENTER);
        Font font = label.getFont();

        label.setFont(font.deriveFont(14.0f).deriveFont(Font.BOLD));

        JPanel container = new JPanel(new BorderLayout());

        container.add(panel, BorderLayout.CENTER);
        container.add(label, BorderLayout.SOUTH);

        formFrame.setContentPane(container);

        panel.addMouseMotionListener(new MouseAdapter() {
            @Override
            public void mouseMoved(MouseEvent e) {
                //System.out.println(e.getPoint());
            }
        });

        formFrame.setVisible(true);
        formFrame.setSize(new Dimension(formPanelInfo.getMaxWidth() + 10, formPanelInfo.getMaxHeight() + 25));
    }
}

From source file:jeplus.gui.EPlusEditorPanel.java

/**
 * This method is called from within the constructor to initialise the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from ww w .  j  a  v  a 2  s .com
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    rTextScrollPane1 = new org.fife.ui.rtextarea.RTextScrollPane();
    rsTextArea = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea();
    jToolBar1 = new javax.swing.JToolBar();
    cmdLoad = new javax.swing.JButton();
    cmdCheck = new javax.swing.JButton();
    cmdSave = new javax.swing.JButton();
    jSeparator2 = new javax.swing.JToolBar.Separator();
    jLabel2 = new javax.swing.JLabel();
    cboSearchStrings = new javax.swing.JComboBox();
    cmdRefresh = new javax.swing.JButton();
    jSeparator1 = new javax.swing.JToolBar.Separator();
    jLabel1 = new javax.swing.JLabel();
    searchField = new javax.swing.JTextField();
    prevButton = new javax.swing.JButton();
    nextButton = new javax.swing.JButton();
    jSeparator3 = new javax.swing.JToolBar.Separator();
    regexCB = new javax.swing.JCheckBox();
    matchCaseCB = new javax.swing.JCheckBox();

    setLayout(new java.awt.BorderLayout());

    rsTextArea.setColumns(60);
    rsTextArea.setRows(20);
    rsTextArea.setToolTipText("");
    rsTextArea.setCodeFoldingEnabled(true);
    rTextScrollPane1.setViewportView(rsTextArea);

    add(rTextScrollPane1, java.awt.BorderLayout.CENTER);

    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);
    jToolBar1.setMinimumSize(new java.awt.Dimension(0, 0));

    cmdLoad.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/folder.png"))); // NOI18N
    cmdLoad.setToolTipText("Open a new file or reload the current file.");
    cmdLoad.setFocusable(false);
    cmdLoad.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    cmdLoad.setMargin(new java.awt.Insets(2, 2, 2, 2));
    cmdLoad.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdLoadActionPerformed(evt);
        }
    });
    jToolBar1.add(cmdLoad);

    cmdCheck.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/check.png"))); // NOI18N
    cmdCheck.setFocusable(false);
    cmdCheck.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    cmdCheck.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    cmdCheck.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdCheckActionPerformed(evt);
        }
    });
    jToolBar1.add(cmdCheck);

    cmdSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/save1.png"))); // NOI18N
    cmdSave.setToolTipText("Save the current file");
    cmdSave.setFocusable(false);
    cmdSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    cmdSave.setMargin(new java.awt.Insets(2, 2, 2, 2));
    cmdSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdSaveActionPerformed(evt);
        }
    });
    jToolBar1.add(cmdSave);

    jSeparator2.setForeground(new java.awt.Color(153, 153, 153));
    jSeparator2.setMaximumSize(new java.awt.Dimension(60, 32767));
    jSeparator2.setPreferredSize(new java.awt.Dimension(30, 0));
    jToolBar1.add(jSeparator2);

    jLabel2.setText("Tags: ");
    jToolBar1.add(jLabel2);

    cboSearchStrings.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
    cboSearchStrings.setToolTipText("Select a search string to locate it in the file.");
    cboSearchStrings.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cboSearchStringsActionPerformed(evt);
        }
    });
    jToolBar1.add(cboSearchStrings);

    cmdRefresh.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/view-refresh.png"))); // NOI18N
    cmdRefresh.setToolTipText("Update search strings from the project.");
    cmdRefresh.setFocusable(false);
    cmdRefresh.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    cmdRefresh.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    cmdRefresh.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdRefreshActionPerformed(evt);
        }
    });
    jToolBar1.add(cmdRefresh);

    jSeparator1.setMaximumSize(new java.awt.Dimension(60, 32767));
    jSeparator1.setPreferredSize(new java.awt.Dimension(30, 0));
    jToolBar1.add(jSeparator1);

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
    jLabel1.setText("Text search: ");
    jLabel1.setMaximumSize(new java.awt.Dimension(80, 14));
    jToolBar1.add(jLabel1);

    searchField.setColumns(30);
    searchField.setToolTipText("Text search");
    searchField.setMaximumSize(new java.awt.Dimension(100, 25));
    searchField.setPreferredSize(new java.awt.Dimension(200, 20));
    jToolBar1.add(searchField);

    prevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/go-previous.png"))); // NOI18N
    prevButton.setToolTipText("Search backwards from the cursor.");
    prevButton.setFocusable(false);
    prevButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jToolBar1.add(prevButton);

    nextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/jeplus/images/go-next.png"))); // NOI18N
    nextButton.setToolTipText("Search forward from the cursor.");
    nextButton.setFocusable(false);
    nextButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jToolBar1.add(nextButton);

    jSeparator3.setMaximumSize(new java.awt.Dimension(60, 32767));
    jSeparator3.setPreferredSize(new java.awt.Dimension(30, 0));
    jToolBar1.add(jSeparator3);

    regexCB.setText("Regex");
    regexCB.setToolTipText("Use Regular Expression. For an example, try search \"@@.*@@\"");
    regexCB.setFocusable(false);
    regexCB.setMaximumSize(new java.awt.Dimension(120, 31));
    regexCB.setPreferredSize(new java.awt.Dimension(80, 31));
    jToolBar1.add(regexCB);

    matchCaseCB.setText("Match case");
    matchCaseCB.setToolTipText("Match cases in search");
    matchCaseCB.setFocusable(false);
    matchCaseCB.setMaximumSize(new java.awt.Dimension(120, 15));
    matchCaseCB.setPreferredSize(new java.awt.Dimension(90, 15));
    jToolBar1.add(matchCaseCB);

    add(jToolBar1, java.awt.BorderLayout.PAGE_START);
}

From source file:uk.ac.ox.cbrg.cpfp.uploadapp.UploadApplet.java

/** This method is called from within the init() method to
 * initialize the form.//from  w  w w .  j  a v a 2 s.  co  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    fileTable = new javax.swing.JTable();
    btnAdd = new javax.swing.JButton();
    btnDel = new javax.swing.JButton();
    btnUpload = new javax.swing.JButton();
    prgUploadProgress = new javax.swing.JProgressBar();
    lblProgress = new javax.swing.JLabel();
    lblMessages = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    txtMessages = new javax.swing.JTextArea();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();

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

    }, new String[] { "Filename", "Size" }) {
        Class[] types = new Class[] { java.lang.String.class, java.lang.String.class };
        boolean[] canEdit = new boolean[] { false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    fileTable.setColumnSelectionAllowed(true);
    fileTable.getTableHeader().setReorderingAllowed(false);
    jScrollPane1.setViewportView(fileTable);
    fileTable.getColumnModel().getSelectionModel()
            .setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    btnAdd.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-plus.png"))); // NOI18N
    btnAdd.setText("Add File(s)");
    btnAdd.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddActionPerformed(evt);
        }
    });

    btnDel.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-cross.png"))); // NOI18N
    btnDel.setText("Remove File(s)");
    btnDel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnDelActionPerformed(evt);
        }
    });

    btnUpload.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/uk/ac/ox/cbrg/cpfp/uploadapp/12-em-up.png"))); // NOI18N
    btnUpload.setText("Upload Files");
    btnUpload.setEnabled(false);
    btnUpload.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnUploadActionPerformed(evt);
        }
    });

    prgUploadProgress.setStringPainted(true);

    lblProgress.setText("Progress:");

    lblMessages.setText("Messages:");

    txtMessages.setColumns(20);
    txtMessages.setRows(5);
    jScrollPane2.setViewportView(txtMessages);

    jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD,
            jLabel1.getFont().getSize() + 3));
    jLabel1.setForeground(javax.swing.UIManager.getDefaults().getColor("textText"));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("CPFP File Uploader");

    jLabel2.setText("2011.10.04");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(prgUploadProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
                    .addComponent(lblProgress)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGroup(
                            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup().addComponent(btnAdd)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(btnDel))
                                    .addComponent(lblMessages))
                            .addGroup(jPanel1Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 257,
                                                    Short.MAX_VALUE))
                                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(103, 103, 103)
                                            .addComponent(jLabel2)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(btnUpload)))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 244,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel1Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(btnAdd).addComponent(btnDel).addComponent(btnUpload)
                                            .addComponent(jLabel1))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lblMessages)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 87,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(lblProgress)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(prgUploadProgress, javax.swing.GroupLayout.PREFERRED_SIZE, 26,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(35, 35, 35))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout
                                    .createSequentialGroup().addComponent(jLabel2).addGap(195, 195, 195)))));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addComponent(jPanel1,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
}

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

@Override
public void createUI() {
    super.createUI();

    databaseSchema = WorkbenchTask.getDatabaseSchema();

    int disciplineeId = AppContextMgr.getInstance().getClassObject(Discipline.class).getDisciplineId();
    SchemaI18NService.getInstance().loadWithLocale(SpLocaleContainer.WORKBENCH_SCHEMA, disciplineeId,
            databaseSchema, SchemaI18NService.getCurrentLocale());

    // Create the Table List
    Vector<TableInfo> tableInfoList = new Vector<TableInfo>();
    for (DBTableInfo ti : databaseSchema.getTables()) {
        if (StringUtils.isNotEmpty(ti.toString())) {
            TableInfo tableInfo = new TableInfo(ti, IconManager.STD_ICON_SIZE);
            tableInfoList.add(tableInfo);

            Vector<FieldInfo> fldList = new Vector<FieldInfo>();
            for (DBFieldInfo fi : ti.getFields()) {
                String fldTitle = fi.getTitle().replace(" ", "");
                if (fldTitle.equalsIgnoreCase(fi.getName())) {
                    //get title from mapped field
                    UploadInfo upInfo = getUploadInfo(fi);
                    DBFieldInfo mInfo = getMappedFieldInfo(fi);
                    if (mInfo != null) {
                        String title = mInfo.getTitle();
                        if (upInfo != null && upInfo.getSequence() != -1) {
                            title += " " + (upInfo.getSequence() + 1);
                        }//w w w  .ja v  a2  s .co  m
                        //if mapped-to table is different than the container table used
                        // in the wb, add the mapped-to table's title
                        if (mInfo.getTableInfo().getTableId() != ti.getTableId()) {
                            title = mInfo.getTableInfo().getTitle() + " " + title;
                        }
                        fi.setTitle(title);
                    }
                }
                fldList.add(new FieldInfo(ti, fi));
            }
            //Collections.sort(fldList);
            tableInfo.setFieldItems(fldList);
        }
    }
    Collections.sort(tableInfoList);

    fieldModel = new DefaultModifiableListModel<FieldInfo>();
    tableModel = new DefaultModifiableListModel<TableInfo>();
    for (TableInfo ti : tableInfoList) {
        tableModel.add(ti);

        // only added for layout
        for (FieldInfo fi : ti.getFieldItems()) {
            fieldModel.add(fi);
        }
    }

    tableList = new JList(tableModel);
    tableList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    tableList.setCellRenderer(tableInfoListRenderer = new TableInfoListRenderer(IconManager.STD_ICON_SIZE));
    JScrollPane tableScrollPane = new JScrollPane(tableList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    tableList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                Object selObj = tableList.getSelectedValue();
                if (selObj != null) {
                    fillFieldList((TableInfo) selObj);
                }
                updateEnabledState();
            }
        }
    });

    fieldList = new JList(fieldModel);
    fieldList.setCellRenderer(tableInfoListRenderer = new TableInfoListRenderer(IconManager.STD_ICON_SIZE));
    fieldList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    JScrollPane fieldScrollPane = new JScrollPane(fieldList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    fieldList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                updateEnabledState();
                updateFieldDescription();
            }
        }
    });

    mapModel = new DefaultModifiableListModel<FieldMappingPanel>();
    mapList = new JList(mapModel);
    mapList.setCellRenderer(new MapCellRenderer());
    mapList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    mapScrollPane = new JScrollPane(mapList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    mapList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                FieldMappingPanel fmp = (FieldMappingPanel) mapList.getSelectedValue();
                if (fmp != null) {
                    ignoreMapListUpdate = true;

                    FieldInfo fldInfo = fmp.getFieldInfo();
                    if (fldInfo != null) {
                        for (int i = 0; i < tableModel.size(); i++) {
                            TableInfo tblInfo = (TableInfo) tableModel.get(i);
                            if (fldInfo.getTableinfo() == tblInfo.getTableInfo()) {
                                tableList.setSelectedValue(tblInfo, true);
                                fillFieldList(tblInfo);
                                //System.out.println(fldInfo.hashCode()+" "+fldInfo.getFieldInfo().hashCode());
                                fieldList.setSelectedValue(fldInfo, true);
                                updateFieldDescription();
                                break;
                            }
                        }
                    }
                    ignoreMapListUpdate = false;
                    updateEnabledState();
                }
            }
        }
    });

    upBtn = createIconBtn("ReorderUp", "WB_MOVE_UP", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            int inx = mapList.getSelectedIndex();
            FieldMappingPanel fmp = mapModel.getElementAt(inx);

            mapModel.remove(fmp);
            mapModel.insertElementAt(fmp, inx - 1);
            mapList.setSelectedIndex(inx - 1);
            updateEnabledState();
            setChanged(true);
        }
    });
    downBtn = createIconBtn("ReorderDown", "WB_MOVE_DOWN", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            int inx = mapList.getSelectedIndex();
            FieldMappingPanel fmp = mapModel.getElementAt(inx);

            mapModel.remove(fmp);
            mapModel.insertElementAt(fmp, inx + 1);
            mapList.setSelectedIndex(inx + 1);
            updateEnabledState();
            setChanged(true);
        }
    });

    JButton dumpMappingBtn = createIconBtn("BlankIcon", IconManager.IconSize.Std16, "WB_MAPPING_DUMP",
            new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    dumpMapping();
                }
            });
    dumpMappingBtn.setEnabled(true);
    dumpMappingBtn.setFocusable(false);
    dumpMappingBtn.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseEntered(MouseEvent e) {
            ((JButton) e.getSource()).setIcon(IconManager.getIcon("Save", IconManager.IconSize.Std16));
            super.mouseEntered(e);
        }

        @Override
        public void mouseExited(MouseEvent e) {
            ((JButton) e.getSource()).setIcon(IconManager.getIcon("BlankIcon", IconManager.IconSize.Std16));
            super.mouseExited(e);
        }

    });

    mapToBtn = createIconBtn("Map", "WB_ADD_MAPPING_ITEM", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            map();
        }
    });
    unmapBtn = createIconBtn("Unmap", "WB_REMOVE_MAPPING_ITEM", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            unmap();
        }
    });

    // Adjust all Labels depending on whether we are creating a new template or not
    // and whether it is from a file or not
    String mapListLeftLabel;
    String mapListRightLabel;

    // Note: if workbenchTemplate is null then it is 
    String dataTypeLabel = getResourceString("WB_DATA_TYPE");
    String fieldsLabel = getResourceString("WB_FIELDS");

    mapListLeftLabel = fieldsLabel;
    mapListRightLabel = getResourceString("WB_COLUMNS");

    CellConstraints cc = new CellConstraints();

    JPanel mainLayoutPanel = new JPanel();

    PanelBuilder labelsBldr = new PanelBuilder(new FormLayout("p, f:p:g, p", "p"));
    labelsBldr.add(createLabel(mapListLeftLabel, SwingConstants.LEFT), cc.xy(1, 1));
    labelsBldr.add(createLabel(mapListRightLabel, SwingConstants.RIGHT), cc.xy(3, 1));

    PanelBuilder upDownPanel = new PanelBuilder(new FormLayout("p", "p,f:p:g, p, 2px, p, f:p:g"));
    upDownPanel.add(dumpMappingBtn, cc.xy(1, 1));
    upDownPanel.add(upBtn, cc.xy(1, 3));
    upDownPanel.add(downBtn, cc.xy(1, 5));

    PanelBuilder middlePanel = new PanelBuilder(new FormLayout("c:p:g", "p, 2px, p"));
    middlePanel.add(mapToBtn, cc.xy(1, 1));
    middlePanel.add(unmapBtn, cc.xy(1, 3));

    btnPanel = middlePanel.getPanel();
    btnPanel.setOpaque(false);

    PanelBuilder outerMiddlePanel = new PanelBuilder(new FormLayout("c:p:g", "f:p:g, p, f:p:g"));
    outerMiddlePanel.add(btnPanel, cc.xy(1, 2));
    outerMiddlePanel.getPanel().setOpaque(false);

    // Main Pane Layout
    PanelBuilder builder = new PanelBuilder(
            new FormLayout("f:max(200px;p):g, 5px, max(200px;p), 5px, p:g, 5px, f:max(250px;p):g, 2px, p",
                    "p, 2px, f:max(350px;p):g"),
            mainLayoutPanel);

    builder.add(createLabel(dataTypeLabel, SwingConstants.CENTER), cc.xy(1, 1));
    builder.add(createLabel(fieldsLabel, SwingConstants.CENTER), cc.xy(3, 1));
    builder.add(labelsBldr.getPanel(), cc.xy(7, 1));

    builder.add(tableScrollPane, cc.xy(1, 3));
    builder.add(fieldScrollPane, cc.xy(3, 3));

    builder.add(outerMiddlePanel.getPanel(), cc.xy(5, 3));

    builder.add(mapScrollPane, cc.xy(7, 3));
    builder.add(upDownPanel.getPanel(), cc.xy(9, 3));

    mainLayoutPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

    JPanel megaPanel = new JPanel(new BorderLayout());
    megaPanel.add(mainLayoutPanel, BorderLayout.CENTER);
    descriptionLbl = createLabel("  ", SwingConstants.LEFT);
    //PanelBuilder descBuilder = new PanelBuilder(new FormLayout("f:p:g, 3dlu","p"));
    //descBuilder.add(descriptionLbl, cc.xy(1, 1));
    //megaPanel.add(descBuilder.getPanel(), BorderLayout.SOUTH);
    megaPanel.add(descriptionLbl, BorderLayout.SOUTH);
    //contentPanel = mainLayoutPanel;
    contentPanel = megaPanel;

    Color bgColor = btnPanel.getBackground();
    int inc = 16;
    btnPanelColor = new Color(Math.min(255, bgColor.getRed() + inc), Math.min(255, bgColor.getGreen() + inc),
            Math.min(255, bgColor.getBlue() + inc));
    btnPanel.setBackground(btnPanelColor);
    btnPanel.setBorder(BorderFactory.createEmptyBorder(4, 6, 4, 6));

    okBtn.setEnabled(false);

    HelpMgr.registerComponent(helpBtn, helpContext);

    if (dataFileInfo != null) {
        autoMapFromDataFile(dataFileInfo.getColInfo());
    }
    if (workbenchTemplate != null) {
        fillFromTemplate();
        setChanged(false);
    }

    mainPanel.add(contentPanel, BorderLayout.CENTER);

    if (dataFileInfo == null) //can't add new mappings when importing.
    {
        FieldMappingPanel fmp = addMappingItem(null,
                IconManager.getIcon("BlankIcon", IconManager.STD_ICON_SIZE), null);
        fmp.setAdded(true);
        fmp.setNew(true);
    }

    pack();

    SwingUtilities.invokeLater(new Runnable() {
        @SuppressWarnings("synthetic-access")
        public void run() {
            cancelBtn.requestFocus();
            fieldModel.clear();
            fieldList.clearSelection();
            updateFieldDescription();
            updateEnabledState();

            if (mapModel.size() > 1) {
                mapList.clearSelection();
            }
        }
    });
}

From source file:edu.harvard.i2b2.query.QueryConceptTreePanel.java

/** This method is called from within the constructor to
 * initialize the form.//from w  w  w.  j  av a  2s. c o m
 */
private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jClearButton = new javax.swing.JButton();
    jConstrainButton = new javax.swing.JButton();
    jExcludeButton = new javax.swing.JButton();
    jOccurrenceButton = new javax.swing.JButton();
    jNameLabel = new javax.swing.JLabel();

    setLayout(null);

    QueryConceptTreeNodeData tmpData = new QueryConceptTreeNodeData();
    tmpData.name("working ......");
    tmpData.tooltip("A root node");
    tmpData.visualAttribute("FAO");
    top = new DefaultMutableTreeNode(tmpData);
    //top = new DefaultMutableTreeNode("Root Node");
    treeModel = new DefaultTreeModel(top);
    //treeModel.addTreeModelListener(new MyTreeModelListener());

    jTree1 = new JTree(treeModel);
    jTree1.setEditable(true);
    //jTree1.getSelectionModel().setSelectionMode
    //        (TreeSelectionModel.SINGLE_TREE_SELECTION);
    //jTree1.setShowsRootHandles(true);
    //JScrollPane treeView = new JScrollPane(jTree1);
    jTree1.setRootVisible(false);
    jTree1.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    jTree1.setCellRenderer(new MyRenderer());
    ToolTipManager.sharedInstance().registerComponent(jTree1);

    setBorder(javax.swing.BorderFactory.createEtchedBorder());
    add(jScrollPane1);
    //jScrollPane1.setBounds(0, 40, 180, 200);

    jClearButton.setFont(new java.awt.Font("Tahoma", 1, 11));
    jClearButton.setText("X");
    jClearButton.setToolTipText("Clear all items from panel");
    jClearButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jClearButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jClearButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jClearButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearButtonActionPerformed(evt);
        }
    });

    add(jClearButton);
    jClearButton.setBounds(160, 0, 18, 20);

    jConstrainButton.setText("Dates");
    jConstrainButton.setToolTipText("Constrain group by dates");
    jConstrainButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jConstrainButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jConstrainButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jConstrainButtonActionPerformed(evt);
        }
    });

    add(jConstrainButton);
    jConstrainButton.setBounds(0, 20, 40, 21);

    jOccurrenceButton.setText("Occurs > 0x");
    jOccurrenceButton.setToolTipText("Set occurrence times");
    jOccurrenceButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jOccurrenceButton.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jOccurrenceButton.setMargin(new java.awt.Insets(6, 6, 6, 6));
    jOccurrenceButton.setIconTextGap(0);
    jOccurrenceButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jOccurrenceButtonActionPerformed(evt);
        }
    });
    add(jOccurrenceButton);
    jOccurrenceButton.setBounds(40, 20, 90, 21);

    //jExcludeButton.setMnemonic('E');
    jExcludeButton.setText("Exclude");
    jExcludeButton.setToolTipText("Exclude all items in group");
    jExcludeButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jExcludeButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jExcludeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jExcludeButtonActionPerformed(evt);
        }
    });

    add(jExcludeButton);
    jExcludeButton.setBounds(130, 20, 48, 21);
    jExcludeButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

    jNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jNameLabel.setText("Group 1");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jNameLabel);
    jNameLabel.setBounds(0, 0, 160, 20);

    jTree1.addTreeExpansionListener(this);
    jTree1.setTransferHandler(new TextHandler());
    add(jScrollPane1);
    jScrollPane1.setViewportView(jTree1);
    //jTree1.setToolTipText("Double click on a folder to view the items inside");
    //jScrollPane1.getViewport().setToolTipText("Double click on a folder to view the items inside");
    jScrollPane1.setBounds(0, 40, 180, 160);
}