Example usage for javax.swing JTable AUTO_RESIZE_LAST_COLUMN

List of usage examples for javax.swing JTable AUTO_RESIZE_LAST_COLUMN

Introduction

In this page you can find the example usage for javax.swing JTable AUTO_RESIZE_LAST_COLUMN.

Prototype

int AUTO_RESIZE_LAST_COLUMN

To view the source code for javax.swing JTable AUTO_RESIZE_LAST_COLUMN.

Click Source Link

Document

During all resize operations, apply adjustments to the last column only.

Usage

From source file:nz.govt.natlib.ndha.manualdeposit.ManualDepositPresenter.java

private void addMetaDataTableModelAndHandlers() throws Exception {
    metaDataTableModel = new MetaDataTableModel(userGroupData, MetaDataFields.ECMSSystem.CMS2);
    metaDataTableModel.addTableModelListener(new MetaDataTableModelListener());
    if (theMetaDataTable == null) {
        return;//from   w  ww  .ja  v a2s  . c  o m
    }
    theMetaDataTable.setModel(metaDataTableModel);
    theMetaDataTable.setSurrendersFocusOnKeystroke(true);
    theMetaDataTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    theMetaDataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    theMetaDataTable.setColumnSelectionAllowed(true);
    theMetaDataTable.setRowSelectionAllowed(true);
    setupMetaDataColumns();
}

From source file:org.formic.wizard.step.gui.FeatureListStep.java

/**
 * {@inheritDoc}// w  w  w  . j a  v  a 2 s.  c o m
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init() {
    featureInfo = new JEditorPane("text/html", StringUtils.EMPTY);
    featureInfo.setEditable(false);
    featureInfo.addHyperlinkListener(new HyperlinkListener());

    Feature[] features = provider.getFeatures();
    JTable table = new JTable(features.length, 1) {
        private static final long serialVersionUID = 1L;

        public Class getColumnClass(int column) {
            return getValueAt(0, column).getClass();
        }

        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };
    table.setBackground(new javax.swing.JList().getBackground());

    GuiForm form = createForm();

    for (int ii = 0; ii < features.length; ii++) {
        final Feature feature = (Feature) features[ii];
        final JCheckBox box = new JCheckBox();

        String name = getName() + '.' + feature.getKey();
        form.bind(name, box);

        box.putClientProperty("feature", feature);
        featureMap.put(feature.getKey(), box);

        if (feature.getInfo() == null) {
            feature.setInfo(Installer.getString(getName() + "." + feature.getKey() + ".html"));
        }
        feature.addPropertyChangeListener(new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
                if (Feature.ENABLED_PROPERTY.equals(event.getPropertyName())) {
                    if (box.isSelected() != feature.isEnabled()) {
                        box.setSelected(feature.isEnabled());
                    }
                }
            }
        });

        box.setText(Installer.getString(name));
        box.setBackground(table.getBackground());
        if (!feature.isAvailable()) {
            box.setSelected(false);
            box.setEnabled(false);
        }
        table.setValueAt(box, ii, 0);
    }

    FeatureListMouseListener mouseListener = new FeatureListMouseListener();
    for (int ii = 0; ii < features.length; ii++) {
        Feature feature = (Feature) features[ii];
        if (feature.isEnabled() && feature.isAvailable()) {
            JCheckBox box = (JCheckBox) featureMap.get(feature.getKey());
            box.setSelected(true);
            mouseListener.processDependencies(feature);
            mouseListener.processExclusives(feature);
        }
    }

    table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setShowHorizontalLines(false);
    table.setShowVerticalLines(false);
    table.setDefaultRenderer(JCheckBox.class, new ComponentTableCellRenderer());

    table.addKeyListener(new FeatureListKeyListener());
    table.addMouseListener(mouseListener);
    table.getSelectionModel().addListSelectionListener(new FeatureListSelectionListener(table));

    table.setRowSelectionInterval(0, 0);

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    JPanel container = new JPanel(new BorderLayout());
    container.add(table, BorderLayout.CENTER);
    panel.add(new JScrollPane(container), BorderLayout.CENTER);
    JScrollPane infoScroll = new JScrollPane(featureInfo);
    infoScroll.setMinimumSize(new Dimension(0, 50));
    infoScroll.setMaximumSize(new Dimension(0, 50));
    infoScroll.setPreferredSize(new Dimension(0, 50));
    panel.add(infoScroll, BorderLayout.SOUTH);

    return panel;
}

From source file:org.formic.wizard.step.gui.RequirementsValidationStep.java

/**
 * {@inheritDoc}// w  ww  . j a v  a  2 s  . c  om
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init() {
    busyIcon = new ImageIcon(Installer.getImage(getName() + ".busy"));
    okIcon = new ImageIcon(Installer.getImage(getName() + ".ok"));
    warnIcon = new ImageIcon(Installer.getImage(getName() + ".warning"));
    failedIcon = new ImageIcon(Installer.getImage(getName() + ".failed"));

    requirementInfo = new JEditorPane("text/html", StringUtils.EMPTY);
    requirementInfo.setEditable(false);
    requirementInfo.addHyperlinkListener(new HyperlinkListener());

    table = new JTable(1, 2) {
        private static final long serialVersionUID = 1L;

        public Class getColumnClass(int column) {
            Object value = getValueAt(0, column);
            return value != null ? value.getClass() : Object.class;
        }

        public boolean isCellEditable(int row, int column) {
            return false;
        }
    };

    table.setBackground(new javax.swing.JList().getBackground());
    table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.setShowHorizontalLines(false);
    table.setShowVerticalLines(false);
    table.setDefaultRenderer(JLabel.class, new ComponentTableCellRenderer());

    table.getSelectionModel().addListSelectionListener(new RequirementsSelectionListener(table));

    table.setRowSelectionInterval(0, 0);

    retryButton = new JButton(Installer.getString("requirements.retry"));
    retryButton.setVisible(false);
    retryButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            displayed();
        }
    });

    form = createForm();

    JPanel container = new JPanel(new BorderLayout());
    container.add(table, BorderLayout.CENTER);
    JScrollPane infoScroll = new JScrollPane(requirementInfo);

    JPanel panel = new JPanel(new MigLayout("wrap 1", "[fill]", "[] [fill, grow] [fill] []"));
    panel.add(form.createMessagePanel());
    panel.add(new JScrollPane(container), "grow");
    panel.add(infoScroll, "height 50!");
    panel.add(retryButton, "right, width 50!");

    return panel;
}

From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.dialogs.RepositoryTable.java

public RepositoryTable() {
    this.repositoryTableModel = new RepositoryTableModel();
    setAutoCreateRowSorter(true);/*from w ww  .j a v a2s.  co m*/
    setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    setShowHorizontalLines(false);
    setShowVerticalLines(false);
    setModel(repositoryTableModel);
    setIntercellSpacing(new Dimension(0, 0));
    setDefaultRenderer(String.class, new RepositoryEntryCellRenderer());
    setDefaultRenderer(Date.class, new DateCellRenderer());
    setDefaultRenderer(Object.class, new GenericCellRenderer());
}

From source file:org.yccheok.jstock.gui.analysis.WizardSelectIndicatorJPanel.java

/** This method is called from within the constructor to
 * initialize the form.// w w w  .j av a 2 s.  c  o  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() {

    jXHeader1 = new org.jdesktop.swingx.JXHeader();
    jPanel1 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jSplitPane1 = new javax.swing.JSplitPane();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel4 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jEditorPane1 = new javax.swing.JEditorPane();
    jPanel2 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();

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

    java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N
    jXHeader1.setDescription(bundle.getString("WizardSelectIndicatorJPanel_Description")); // NOI18N
    jXHeader1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/32x32/ark2.png"))); // NOI18N
    jXHeader1.setTitle(bundle.getString("WizardSelectIndicatorJPanel_Title")); // NOI18N
    add(jXHeader1, java.awt.BorderLayout.NORTH);

    jPanel1.setLayout(new java.awt.BorderLayout(10, 10));

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

    jSplitPane1.setDividerLocation(230);

    jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Indicators"));
    jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    jTable1.setAutoCreateRowSorter(true);
    jTable1.setModel(getEmptyTableModel());
    jTable1.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
    jTable1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    this.jTable1.getTableHeader().setReorderingAllowed(false);
    // When use with AUTO_RESIZE_LAST_COLUMN, must set locking = true. If not, will not work as expected.
    JTableUtilities.makeTableColumnWidthFit(this.jTable1, 0, 5, true);

    this.jTable1.setDefaultRenderer(String.class, new IndicatorRenderer());
    this.booleanTableCellRenderer = this.jTable1.getDefaultRenderer(Boolean.class);
    this.jTable1.setDefaultRenderer(Boolean.class, new IndicatorRenderer());
    this.jTable1.getSelectionModel().addListSelectionListener(new RowListener());
    jScrollPane1.setViewportView(jTable1);

    jSplitPane1.setLeftComponent(jScrollPane1);

    jPanel4.setLayout(new java.awt.BorderLayout(10, 10));

    jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD,
            jLabel1.getFont().getSize() + 3));
    jLabel1.setText(" ");
    jPanel5.add(jLabel1);

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

    jScrollPane2.setBorder(javax.swing.BorderFactory.createTitledBorder("Description"));
    jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

    jEditorPane1.setContentType("text/html");
    jEditorPane1.setEditable(false);
    jEditorPane1.setMinimumSize(new java.awt.Dimension(20, 20));
    jEditorPane1.setPreferredSize(new java.awt.Dimension(20, 20));
    jEditorPane1.addHyperlinkListener(new javax.swing.event.HyperlinkListener() {
        public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {
            jEditorPane1HyperlinkUpdate(evt);
        }
    });
    jScrollPane2.setViewportView(jEditorPane1);

    jPanel4.add(jScrollPane2, java.awt.BorderLayout.CENTER);

    jSplitPane1.setRightComponent(jPanel4);

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

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

    jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    jLabel3.setText(bundle.getString("WizardSelectIndicatorJPanel_GettingIndicatorInfo...")); // NOI18N
    jPanel2.add(jLabel3);

    jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/spinner.gif"))); // NOI18N
    jLabel2.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jPanel2.add(jLabel2);

    jPanel1.add(jPanel2, java.awt.BorderLayout.NORTH);

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

From source file:pl.otros.logview.gui.LogViewPanel.java

private JPopupMenu initTableContextMenu() {
    JPopupMenu menu = new JPopupMenu("Menu");
    JMenuItem mark = new JMenuItem("Mark selected rows");
    mark.addActionListener(new MarkRowAction(otrosApplication));
    JMenuItem unmark = new JMenuItem("Unmark selected rows");
    unmark.addActionListener(new UnMarkRowAction(otrosApplication));

    JMenuItem autoResizeMenu = new JMenu("Table auto resize mode");
    autoResizeMenu.setIcon(Icons.TABLE_RESIZE);
    JMenuItem autoResizeSubsequent = new JMenuItem("Subsequent columns");
    autoResizeSubsequent/*from ww  w .j  ava  2 s.  c om*/
            .addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS));
    JMenuItem autoResizeLast = new JMenuItem("Last column");
    autoResizeLast.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_LAST_COLUMN));
    JMenuItem autoResizeNext = new JMenuItem("Next column");
    autoResizeNext.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_NEXT_COLUMN));
    JMenuItem autoResizeAll = new JMenuItem("All columns");
    autoResizeAll.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_ALL_COLUMNS));
    JMenuItem autoResizeOff = new JMenuItem("Auto resize off");
    autoResizeOff.addActionListener(new TableResizeActionListener(table, JTable.AUTO_RESIZE_OFF));
    autoResizeMenu.add(autoResizeSubsequent);
    autoResizeMenu.add(autoResizeOff);
    autoResizeMenu.add(autoResizeNext);
    autoResizeMenu.add(autoResizeLast);
    autoResizeMenu.add(autoResizeAll);
    JMenu removeMenu = new JMenu("Remove log events");
    removeMenu.setFont(menuLabelFont);
    removeMenu.setIcon(Icons.BIN);
    JLabel removeLabel = new JLabel("Remove by:");
    removeLabel.setFont(menuLabelFont);
    removeMenu.add(removeLabel);

    Map<String, Set<String>> propKeyValue = getPropertiesOfSelectedLogEvents();
    for (AcceptCondition acceptCondition : acceptConditionList) {
        removeMenu.add(new JMenuItem(new RemoveByAcceptanceCriteria(acceptCondition, otrosApplication)));
    }
    for (String propertyKey : propKeyValue.keySet()) {
        for (String propertyValue : propKeyValue.get(propertyKey)) {
            PropertyAcceptCondition propAcceptCondition = new PropertyAcceptCondition(propertyKey,
                    propertyValue);
            removeMenu
                    .add(new JMenuItem(new RemoveByAcceptanceCriteria(propAcceptCondition, otrosApplication)));
        }
    }

    menu.add(new JSeparator());
    JLabel labelMarkingRows = new JLabel("Marking/unmarking rows");
    labelMarkingRows.setFont(menuLabelFont);
    menu.add(labelMarkingRows);
    menu.add(new JSeparator());
    menu.add(mark);
    menu.add(unmark);
    JMenu[] markersMenu = getAutomaticMarkersMenu();
    menu.add(markersMenu[0]);
    menu.add(markersMenu[1]);
    menu.add(new ClearMarkingsAction(otrosApplication));
    menu.add(new JSeparator());
    JLabel labelQuickFilters = new JLabel("Quick filters");
    labelQuickFilters.setFont(menuLabelFont);
    menu.add(labelQuickFilters);
    menu.add(new JSeparator());
    menu.add(focusOnThisThreadAction);
    menu.add(focusOnEventsAfter);
    menu.add(focusOnEventsBefore);
    menu.add(focusOnSelectedClassesAction);
    menu.add(ignoreSelectedEventsClasses);
    menu.add(focusOnSelectedLoggerNameAction);
    menu.add(showCallHierarchyAction);
    for (String propertyKey : propKeyValue.keySet()) {
        for (String propertyValue : propKeyValue.get(propertyKey)) {
            menu.add(new FocusOnSelectedPropertyAction(propertyFilter, propertyFilterPanel.getEnableCheckBox(),
                    otrosApplication, propertyKey, propertyValue));
        }
    }
    menu.add(new JSeparator());
    menu.add(removeMenu);
    menu.add(new JSeparator());
    JLabel labelTableOptions = new JLabel("Table options");
    labelTableOptions.setFont(menuLabelFont);
    menu.add(labelTableOptions);
    menu.add(new JSeparator());
    menu.add(autoResizeMenu);

    menu.add(new JSeparator());
    List<MenuActionProvider> menuActionProviders = otrosApplication.getLogViewPanelMenuActionProvider();
    for (MenuActionProvider menuActionProvider : menuActionProviders) {
        try {
            List<OtrosAction> actions = menuActionProvider.getActions(otrosApplication, this);
            if (actions == null) {
                continue;
            }
            for (OtrosAction action : actions) {
                menu.add(action);
            }
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Cant get action from from provider " + menuActionProvider, e);
        }
    }

    return menu;
}

From source file:ru.apertum.qsystem.client.forms.FReception.java

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

    popupServiceTree = new javax.swing.JPopupMenu();
    menuItemStand = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JPopupMenu.Separator();
    menuItemAdv = new javax.swing.JMenuItem();
    jSeparator4 = new javax.swing.JPopupMenu.Separator();
    menuItemServDisable = new javax.swing.JMenuItem();
    popupLineList = new javax.swing.JPopupMenu();
    menuSetPriority = new javax.swing.JMenuItem();
    popupPostponed = new javax.swing.JPopupMenu();
    jMenuItem1 = new javax.swing.JMenuItem();
    tabsPane = new javax.swing.JTabbedPane();
    panelServices = new javax.swing.JPanel();
    jPanel7 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    textFieldSerchService = new javax.swing.JTextField();
    jSplitPane1 = new javax.swing.JSplitPane();
    tabbedPaneService = new javax.swing.JTabbedPane();
    jPanel4 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    labelServiceInfo = new javax.swing.JLabel();
    jPanel6 = new javax.swing.JPanel();
    jScrollPane7 = new javax.swing.JScrollPane();
    listUsersOfService = new javax.swing.JList();
    panelLineState = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jScrollPane3 = new javax.swing.JScrollPane();
    listLine = new javax.swing.JList();
    labelWarringOfLineSize = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    treeServices = new javax.swing.JTree();
    panelUsers = new javax.swing.JPanel();
    jSplitPane3 = new javax.swing.JSplitPane();
    jScrollPane6 = new javax.swing.JScrollPane();
    listUsers = new javax.swing.JList();
    jSplitPane4 = new javax.swing.JSplitPane();
    jScrollPane8 = new javax.swing.JScrollPane();
    listServicesForUser = new javax.swing.JList();
    jPanel12 = new javax.swing.JPanel();
    buttonRefreshUser = new javax.swing.JButton();
    jScrollPane9 = new javax.swing.JScrollPane();
    labelUserInfo = new javax.swing.JLabel();
    labelUser = new javax.swing.JLabel();
    panelPrereg = new javax.swing.JPanel();
    calPrereg = new com.toedter.calendar.JCalendar();
    panelTreeCmbx = new javax.swing.JPanel();
    jScrollPane10 = new javax.swing.JScrollPane();
    tablePreReg = new javax.swing.JTable();
    checkBoxPrintAdvTicket = new javax.swing.JCheckBox();
    labelPreDate = new javax.swing.JLabel();
    buttonRemoveAdvanceCustomer = new javax.swing.JButton();
    jPanel8 = new javax.swing.JPanel();
    jSplitPane2 = new javax.swing.JSplitPane();
    jPanel9 = new javax.swing.JPanel();
    buttonRefreshPostponed = new javax.swing.JButton();
    jScrollPane4 = new javax.swing.JScrollPane();
    listPostponed = new javax.swing.JList();
    jPanel10 = new javax.swing.JPanel();
    buttonRefreshBlack = new javax.swing.JButton();
    jScrollPane5 = new javax.swing.JScrollPane();
    listBlack = new javax.swing.JList();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    labelTotalCustomers = new javax.swing.JLabel();
    jSplitPane5 = new javax.swing.JSplitPane();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane11 = new javax.swing.JScrollPane();
    tableUsersMon = new javax.swing.JTable();
    jPanel5 = new javax.swing.JPanel();
    jScrollPane12 = new javax.swing.JScrollPane();
    tableServicesMon = new javax.swing.JTable();
    buttonRefreshMainData = new javax.swing.JButton();
    panelComplexServ = new javax.swing.JPanel();
    MenuBar = new javax.swing.JMenuBar();
    menuFile = new javax.swing.JMenu();
    menuRefreshMainData = new javax.swing.JMenuItem();
    menuSendMessage = new javax.swing.JMenuItem();
    menuLangs = new javax.swing.JMenu();
    jSeparator1 = new javax.swing.JPopupMenu.Separator();
    menuItemExit = new javax.swing.JMenuItem();
    menuCustomers = new javax.swing.JMenu();
    menuItemChangePriority = new javax.swing.JMenuItem();
    jSeparator3 = new javax.swing.JPopupMenu.Separator();
    menuItemCheckTicket = new javax.swing.JMenuItem();
    menuAbout = new javax.swing.JMenu();
    menuItemAbout = new javax.swing.JMenuItem();

    popupServiceTree.setComponentPopupMenu(popupServiceTree);
    popupServiceTree.setName("popupServiceTree"); // NOI18N

    javax.swing.ActionMap actionMap = org.jdesktop.application.Application
            .getInstance(ru.apertum.qsystem.QSystem.class).getContext().getActionMap(FReception.class, this);
    menuItemStand.setAction(actionMap.get("setInLine")); // NOI18N
    menuItemStand.setName("menuItemStand"); // NOI18N
    popupServiceTree.add(menuItemStand);

    jSeparator2.setName("jSeparator2"); // NOI18N
    popupServiceTree.add(jSeparator2);

    menuItemAdv.setAction(actionMap.get("preReg")); // NOI18N
    menuItemAdv.setName("menuItemAdv"); // NOI18N
    popupServiceTree.add(menuItemAdv);

    jSeparator4.setName("jSeparator4"); // NOI18N
    popupServiceTree.add(jSeparator4);

    menuItemServDisable.setAction(actionMap.get("serviceDisable")); // NOI18N
    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
            .getInstance(ru.apertum.qsystem.QSystem.class).getContext().getResourceMap(FReception.class);
    menuItemServDisable.setText(resourceMap.getString("menuItemServDisable.text")); // NOI18N
    menuItemServDisable.setName("menuItemServDisable"); // NOI18N
    popupServiceTree.add(menuItemServDisable);

    popupLineList.setName("popupLineList"); // NOI18N

    menuSetPriority.setAction(actionMap.get("setPriority")); // NOI18N
    menuSetPriority.setName("menuSetPriority"); // NOI18N
    popupLineList.add(menuSetPriority);

    popupPostponed.setName("popupPostponed"); // NOI18N

    jMenuItem1.setAction(actionMap.get("changeStatusForPostponed")); // NOI18N
    jMenuItem1.setName("jMenuItem1"); // NOI18N
    popupPostponed.add(jMenuItem1);

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle(resourceMap.getString("Form.title")); // NOI18N
    setBackground(resourceMap.getColor("Form.background")); // NOI18N
    setName("Form"); // NOI18N

    tabsPane.setName("tabsPane"); // NOI18N

    panelServices.setName("panelServices"); // NOI18N

    jPanel7.setBorder(new javax.swing.border.MatteBorder(null));
    jPanel7.setName("jPanel7"); // NOI18N

    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    textFieldSerchService.setText(resourceMap.getString("textFieldSerchService.text")); // NOI18N
    textFieldSerchService.setName("textFieldSerchService"); // NOI18N
    textFieldSerchService.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            textFieldSerchServiceKeyReleased(evt);
        }
    });

    javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout
            .setHorizontalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(textFieldSerchService).addContainerGap()));
    jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addGroup(jPanel7Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(textFieldSerchService, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jSplitPane1.setDividerLocation(300);
    jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane1.setResizeWeight(1.0);
    jSplitPane1.setAutoscrolls(true);
    jSplitPane1.setContinuousLayout(true);
    jSplitPane1.setName("jSplitPane1"); // NOI18N

    tabbedPaneService.setName("tabbedPaneService"); // NOI18N

    jPanel4.setName("jPanel4"); // NOI18N

    jScrollPane2.setName("jScrollPane2"); // NOI18N

    labelServiceInfo.setText(resourceMap.getString("labelServiceInfo.text")); // NOI18N
    labelServiceInfo.setVerticalAlignment(javax.swing.SwingConstants.TOP);
    labelServiceInfo.setName("labelServiceInfo"); // NOI18N
    jScrollPane2.setViewportView(labelServiceInfo);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout
            .setHorizontalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1044, Short.MAX_VALUE));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE));

    tabbedPaneService.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

    jPanel6.setName("jPanel6"); // NOI18N

    jScrollPane7.setName("jScrollPane7"); // NOI18N

    listUsersOfService.setName("listUsersOfService"); // NOI18N
    listUsersOfService.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            listUsersOfServiceMouseClicked(evt);
        }
    });
    jScrollPane7.setViewportView(listUsersOfService);

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout
            .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 1044, Short.MAX_VALUE));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE));

    tabbedPaneService.addTab(resourceMap.getString("jPanel6.TabConstraints.tabTitle"), jPanel6); // NOI18N

    panelLineState.setName("panelLineState"); // NOI18N

    jButton1.setAction(actionMap.get("refreshLines")); // NOI18N
    jButton1.setName("jButton1"); // NOI18N

    jScrollPane3.setName("jScrollPane3"); // NOI18N

    listLine.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    listLine.setComponentPopupMenu(popupLineList);
    listLine.setName("listLine"); // NOI18N
    jScrollPane3.setViewportView(listLine);

    labelWarringOfLineSize.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    labelWarringOfLineSize.setText(resourceMap.getString("labelWarringOfLineSize.text")); // NOI18N
    labelWarringOfLineSize.setToolTipText(resourceMap.getString("labelWarringOfLineSize.toolTipText")); // NOI18N
    labelWarringOfLineSize.setName("labelWarringOfLineSize"); // NOI18N

    javax.swing.GroupLayout panelLineStateLayout = new javax.swing.GroupLayout(panelLineState);
    panelLineState.setLayout(panelLineStateLayout);
    panelLineStateLayout.setHorizontalGroup(panelLineStateLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLineStateLayout.createSequentialGroup()
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(panelLineStateLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(labelWarringOfLineSize, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));
    panelLineStateLayout.setVerticalGroup(
            panelLineStateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            panelLineStateLayout.createSequentialGroup().addContainerGap()
                                    .addComponent(labelWarringOfLineSize, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            103, Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jButton1).addContainerGap())
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE));

    tabbedPaneService.addTab(resourceMap.getString("panelLineState.TabConstraints.tabTitle"), panelLineState); // NOI18N

    jSplitPane1.setBottomComponent(tabbedPaneService);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    treeServices.setAutoscrolls(true);
    treeServices.setComponentPopupMenu(popupServiceTree);
    treeServices.setName("treeServices"); // NOI18N
    treeServices.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            treeServicesMouseClicked(evt);
        }
    });
    treeServices.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyReleased(java.awt.event.KeyEvent evt) {
            treeServicesKeyReleased(evt);
        }
    });
    jScrollPane1.setViewportView(treeServices);

    jSplitPane1.setLeftComponent(jScrollPane1);

    javax.swing.GroupLayout panelServicesLayout = new javax.swing.GroupLayout(panelServices);
    panelServices.setLayout(panelServicesLayout);
    panelServicesLayout.setHorizontalGroup(panelServicesLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel7,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING));
    panelServicesLayout.setVerticalGroup(panelServicesLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelServicesLayout.createSequentialGroup()
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)));

    tabsPane.addTab(resourceMap.getString("panelServices.TabConstraints.tabTitle"), panelServices); // NOI18N

    panelUsers.setName("panelUsers"); // NOI18N

    jSplitPane3.setDividerLocation(250);
    jSplitPane3.setContinuousLayout(true);
    jSplitPane3.setName("jSplitPane3"); // NOI18N

    jScrollPane6.setName("jScrollPane6"); // NOI18N

    listUsers.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("listUsers.border.title"))); // NOI18N
    listUsers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    listUsers.setName("listUsers"); // NOI18N
    listUsers.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            listUsersMouseClicked(evt);
        }
    });
    jScrollPane6.setViewportView(listUsers);

    jSplitPane3.setLeftComponent(jScrollPane6);

    jSplitPane4.setDividerLocation(200);
    jSplitPane4.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane4.setContinuousLayout(true);
    jSplitPane4.setName("jSplitPane4"); // NOI18N

    jScrollPane8.setName("jScrollPane8"); // NOI18N

    listServicesForUser.setBorder(javax.swing.BorderFactory
            .createTitledBorder(resourceMap.getString("listServicesForUser.border.title"))); // NOI18N
    listServicesForUser.setName("listServicesForUser"); // NOI18N
    listServicesForUser.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            listServicesForUserMouseClicked(evt);
        }
    });
    jScrollPane8.setViewportView(listServicesForUser);

    jSplitPane4.setTopComponent(jScrollPane8);

    jPanel12.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel12.border.title"))); // NOI18N
    jPanel12.setName("jPanel12"); // NOI18N

    buttonRefreshUser.setText(resourceMap.getString("buttonRefreshUser.text")); // NOI18N
    buttonRefreshUser.setName("buttonRefreshUser"); // NOI18N
    buttonRefreshUser.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buttonRefreshUserActionPerformed(evt);
        }
    });

    jScrollPane9.setName("jScrollPane9"); // NOI18N

    labelUserInfo.setText(resourceMap.getString("labelUserInfo.text")); // NOI18N
    labelUserInfo.setVerticalAlignment(javax.swing.SwingConstants.TOP);
    labelUserInfo.setName("labelUserInfo"); // NOI18N
    jScrollPane9.setViewportView(labelUserInfo);

    labelUser.setFont(resourceMap.getFont("labelUser.font")); // NOI18N
    labelUser.setText(resourceMap.getString("labelUser.text")); // NOI18N
    labelUser.setName("labelUser"); // NOI18N

    javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
    jPanel12.setLayout(jPanel12Layout);
    jPanel12Layout.setHorizontalGroup(jPanel12Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 761,
                                    Short.MAX_VALUE)
                            .addComponent(labelUser)
                            .addComponent(buttonRefreshUser, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addContainerGap()));
    jPanel12Layout.setVerticalGroup(jPanel12Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                    .addComponent(labelUser).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(buttonRefreshUser)));

    jSplitPane4.setRightComponent(jPanel12);

    jSplitPane3.setRightComponent(jSplitPane4);

    javax.swing.GroupLayout panelUsersLayout = new javax.swing.GroupLayout(panelUsers);
    panelUsers.setLayout(panelUsersLayout);
    panelUsersLayout
            .setHorizontalGroup(panelUsersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1051, Short.MAX_VALUE));
    panelUsersLayout
            .setVerticalGroup(panelUsersLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane3, javax.swing.GroupLayout.Alignment.TRAILING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, 598, Short.MAX_VALUE));

    tabsPane.addTab(resourceMap.getString("panelUsers.TabConstraints.tabTitle"), panelUsers); // NOI18N

    panelPrereg.setName("panelPrereg"); // NOI18N

    calPrereg.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    calPrereg.setFont(resourceMap.getFont("calPrereg.font")); // NOI18N
    calPrereg.setName("calPrereg"); // NOI18N
    calPrereg.setTodayButtonVisible(true);
    calPrereg.setWeekOfYearVisible(false);
    calPrereg.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            calPreregPropertyChange(evt);
        }
    });

    panelTreeCmbx.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("panelTreeCmbx.border.title"))); // NOI18N
    panelTreeCmbx.setName("panelTreeCmbx"); // NOI18N

    javax.swing.GroupLayout panelTreeCmbxLayout = new javax.swing.GroupLayout(panelTreeCmbx);
    panelTreeCmbx.setLayout(panelTreeCmbxLayout);
    panelTreeCmbxLayout.setHorizontalGroup(panelTreeCmbxLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1039, Short.MAX_VALUE));
    panelTreeCmbxLayout.setVerticalGroup(panelTreeCmbxLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 36, Short.MAX_VALUE));

    jScrollPane10.setName("jScrollPane10"); // NOI18N

    tablePreReg.setAutoCreateRowSorter(true);
    tablePreReg.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {

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

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

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });
    tablePreReg.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN);
    tablePreReg.setName("tablePreReg"); // NOI18N
    tablePreReg.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    tablePreReg.setShowVerticalLines(false);
    tablePreReg.getTableHeader().setResizingAllowed(false);
    tablePreReg.getTableHeader().setReorderingAllowed(false);
    tablePreReg.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tablePreRegMouseClicked(evt);
        }
    });
    jScrollPane10.setViewportView(tablePreReg);

    checkBoxPrintAdvTicket.setSelected(true);
    checkBoxPrintAdvTicket.setText(resourceMap.getString("checkBoxPrintAdvTicket.text")); // NOI18N
    checkBoxPrintAdvTicket.setName("checkBoxPrintAdvTicket"); // NOI18N
    checkBoxPrintAdvTicket.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            checkBoxPrintAdvTicketItemStateChanged(evt);
        }
    });

    labelPreDate.setFont(resourceMap.getFont("labelPreDate.font")); // NOI18N
    labelPreDate.setText(resourceMap.getString("labelPreDate.text")); // NOI18N
    labelPreDate.setName("labelPreDate"); // NOI18N

    buttonRemoveAdvanceCustomer.setText(resourceMap.getString("buttonRemoveAdvanceCustomer.text")); // NOI18N
    buttonRemoveAdvanceCustomer.setName("buttonRemoveAdvanceCustomer"); // NOI18N
    buttonRemoveAdvanceCustomer.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buttonRemoveAdvanceCustomerActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout panelPreregLayout = new javax.swing.GroupLayout(panelPrereg);
    panelPrereg.setLayout(panelPreregLayout);
    panelPreregLayout.setHorizontalGroup(panelPreregLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelTreeCmbx, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(panelPreregLayout.createSequentialGroup().addContainerGap()
                    .addGroup(panelPreregLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(panelPreregLayout.createSequentialGroup()
                                    .addComponent(calPrereg, javax.swing.GroupLayout.PREFERRED_SIZE, 250,
                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(panelPreregLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(panelPreregLayout.createSequentialGroup()
                                                    .addComponent(labelPreDate).addContainerGap())
                                            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    785, Short.MAX_VALUE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                    panelPreregLayout.createSequentialGroup()
                                            .addComponent(checkBoxPrintAdvTicket)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    691, Short.MAX_VALUE)
                                            .addComponent(buttonRemoveAdvanceCustomer).addContainerGap()))));
    panelPreregLayout.setVerticalGroup(panelPreregLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPreregLayout.createSequentialGroup()
                    .addComponent(panelTreeCmbx, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(panelPreregLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(calPrereg, javax.swing.GroupLayout.PREFERRED_SIZE, 250,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(panelPreregLayout.createSequentialGroup().addComponent(labelPreDate)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 462,
                                            Short.MAX_VALUE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(panelPreregLayout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(buttonRemoveAdvanceCustomer)
                                            .addComponent(checkBoxPrintAdvTicket))
                                    .addContainerGap()))));

    tabsPane.addTab(resourceMap.getString("panelPrereg.TabConstraints.tabTitle"), panelPrereg); // NOI18N

    jPanel8.setName("jPanel8"); // NOI18N

    jSplitPane2.setDividerLocation(251);
    jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane2.setName("jSplitPane2"); // NOI18N

    jPanel9.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel9.border.title"))); // NOI18N
    jPanel9.setName("jPanel9"); // NOI18N

    buttonRefreshPostponed.setText(resourceMap.getString("buttonRefreshPostponed.text")); // NOI18N
    buttonRefreshPostponed.setName("buttonRefreshPostponed"); // NOI18N
    buttonRefreshPostponed.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buttonRefreshPostponedActionPerformed(evt);
        }
    });

    jScrollPane4.setName("jScrollPane4"); // NOI18N

    listPostponed.setComponentPopupMenu(popupPostponed);
    listPostponed.setName("listPostponed"); // NOI18N
    jScrollPane4.setViewportView(listPostponed);

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(jPanel9Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 938, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(buttonRefreshPostponed).addContainerGap()));
    jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    jPanel9Layout.createSequentialGroup().addContainerGap(193, Short.MAX_VALUE)
                            .addComponent(buttonRefreshPostponed).addContainerGap())
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE));

    jSplitPane2.setTopComponent(jPanel9);

    jPanel10.setBorder(
            javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel10.border.title"))); // NOI18N
    jPanel10.setName("jPanel10"); // NOI18N

    buttonRefreshBlack.setText(resourceMap.getString("buttonRefreshBlack.text")); // NOI18N
    buttonRefreshBlack.setName("buttonRefreshBlack"); // NOI18N
    buttonRefreshBlack.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            buttonRefreshBlackActionPerformed(evt);
        }
    });

    jScrollPane5.setName("jScrollPane5"); // NOI18N

    listBlack.setName("listBlack"); // NOI18N
    jScrollPane5.setViewportView(listBlack);

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(jPanel10Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 938, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(buttonRefreshBlack).addContainerGap()));
    jPanel10Layout
            .setVerticalGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel10Layout.createSequentialGroup().addContainerGap(284, Short.MAX_VALUE)
                                    .addComponent(buttonRefreshBlack).addContainerGap())
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE));

    jSplitPane2.setRightComponent(jPanel10);

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(jPanel8Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jSplitPane2));
    jPanel8Layout.setVerticalGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane2, javax.swing.GroupLayout.Alignment.TRAILING));

    tabsPane.addTab(resourceMap.getString("jPanel8.TabConstraints.tabTitle"), jPanel8); // NOI18N

    jPanel1.setName("jPanel1"); // NOI18N

    jPanel2.setBorder(new javax.swing.border.MatteBorder(null));
    jPanel2.setName("jPanel2"); // NOI18N

    labelTotalCustomers.setBackground(resourceMap.getColor("labelTotalCustomers.background")); // NOI18N
    labelTotalCustomers.setFont(resourceMap.getFont("labelTotalCustomers.font")); // NOI18N
    labelTotalCustomers.setText(resourceMap.getString("labelTotalCustomers.text")); // NOI18N
    labelTotalCustomers.setName("labelTotalCustomers"); // NOI18N
    labelTotalCustomers.setOpaque(true);

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(labelTotalCustomers,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addComponent(labelTotalCustomers)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jSplitPane5.setDividerLocation(400);
    jSplitPane5.setContinuousLayout(true);
    jSplitPane5.setName("jSplitPane5"); // NOI18N

    jPanel3.setName("jPanel3"); // NOI18N

    jScrollPane11.setName("jScrollPane11"); // NOI18N

    tableUsersMon.setAutoCreateRowSorter(true);
    tableUsersMon
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tableUsersMon.setName("tableUsersMon"); // NOI18N
    tableUsersMon.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    tableUsersMon.getTableHeader().setReorderingAllowed(false);
    tableUsersMon.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tableUsersMonMouseClicked(evt);
        }
    });
    jScrollPane11.setViewportView(tableUsersMon);

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 399, Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE));

    jSplitPane5.setLeftComponent(jPanel3);

    jPanel5.setName("jPanel5"); // NOI18N

    jScrollPane12.setName("jScrollPane12"); // NOI18N

    tableServicesMon.setAutoCreateRowSorter(true);
    tableServicesMon
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    tableServicesMon.setName("tableServicesMon"); // NOI18N
    tableServicesMon.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    tableServicesMon.getTableHeader().setReorderingAllowed(false);
    tableServicesMon.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tableServicesMonMouseClicked(evt);
        }
    });
    jScrollPane12.setViewportView(tableServicesMon);

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout
            .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 645, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE));

    jSplitPane5.setRightComponent(jPanel5);

    buttonRefreshMainData.setAction(actionMap.get("refreshMainData")); // NOI18N
    buttonRefreshMainData.setText(resourceMap.getString("buttonRefreshMainData.text")); // NOI18N
    buttonRefreshMainData.setName("buttonRefreshMainData"); // NOI18N

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout
            .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jPanel1Layout.createSequentialGroup()
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(buttonRefreshMainData).addContainerGap())
                    .addComponent(jSplitPane5, javax.swing.GroupLayout.Alignment.TRAILING));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSplitPane5)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(buttonRefreshMainData).addContainerGap()));

    tabsPane.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

    panelComplexServ.setName("panelComplexServ"); // NOI18N

    javax.swing.GroupLayout panelComplexServLayout = new javax.swing.GroupLayout(panelComplexServ);
    panelComplexServ.setLayout(panelComplexServLayout);
    panelComplexServLayout.setHorizontalGroup(panelComplexServLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 1051, Short.MAX_VALUE));
    panelComplexServLayout.setVerticalGroup(panelComplexServLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 598, Short.MAX_VALUE));

    tabsPane.addTab(resourceMap.getString("panelComplexServ.TabConstraints.tabTitle"), panelComplexServ); // NOI18N

    MenuBar.setName("MenuBar"); // NOI18N

    menuFile.setText(resourceMap.getString("menuFile.text")); // NOI18N
    menuFile.setName("menuFile"); // NOI18N

    menuRefreshMainData.setAction(actionMap.get("refreshMainData")); // NOI18N
    menuRefreshMainData.setText(resourceMap.getString("menuRefreshMainData.text")); // NOI18N
    menuRefreshMainData.setName("menuRefreshMainData"); // NOI18N
    menuFile.add(menuRefreshMainData);

    menuSendMessage.setAction(actionMap.get("sendMessage")); // NOI18N
    menuSendMessage.setText(resourceMap.getString("menuSendMessage.text")); // NOI18N
    menuSendMessage.setName("menuSendMessage"); // NOI18N
    menuFile.add(menuSendMessage);

    menuLangs.setAction(actionMap.get("setCurrentLang")); // NOI18N
    menuLangs.setText(resourceMap.getString("menuLangs.text")); // NOI18N
    menuLangs.setName("menuLangs"); // NOI18N
    menuFile.add(menuLangs);

    jSeparator1.setName("jSeparator1"); // NOI18N
    menuFile.add(jSeparator1);

    menuItemExit.setAction(actionMap.get("quit")); // NOI18N
    menuItemExit.setText(resourceMap.getString("menuItemExit.text")); // NOI18N
    menuItemExit.setName("menuItemExit"); // NOI18N
    menuFile.add(menuItemExit);

    MenuBar.add(menuFile);

    menuCustomers.setText(resourceMap.getString("menuCustomers.text")); // NOI18N
    menuCustomers.setName("menuCustomers"); // NOI18N

    menuItemChangePriority.setAction(actionMap.get("setAnyPriority")); // NOI18N
    menuItemChangePriority.setText(resourceMap.getString("menuItemChangePriority.text")); // NOI18N
    menuItemChangePriority.setName("menuItemChangePriority"); // NOI18N
    menuCustomers.add(menuItemChangePriority);

    jSeparator3.setName("jSeparator3"); // NOI18N
    menuCustomers.add(jSeparator3);

    menuItemCheckTicket.setAction(actionMap.get("checkAnyTicket")); // NOI18N
    menuItemCheckTicket.setText(resourceMap.getString("menuItemCheckTicket.text")); // NOI18N
    menuItemCheckTicket.setName("menuItemCheckTicket"); // NOI18N
    menuCustomers.add(menuItemCheckTicket);

    MenuBar.add(menuCustomers);

    menuAbout.setText(resourceMap.getString("menuAbout.text")); // NOI18N
    menuAbout.setName("menuAbout"); // NOI18N

    menuItemAbout.setAction(actionMap.get("getAbout")); // NOI18N
    menuItemAbout.setText(resourceMap.getString("menuItemAbout.text")); // NOI18N
    menuItemAbout.setName("menuItemAbout"); // NOI18N
    menuAbout.add(menuItemAbout);

    MenuBar.add(menuAbout);

    setJMenuBar(MenuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabsPane, javax.swing.GroupLayout.Alignment.TRAILING,
                    javax.swing.GroupLayout.DEFAULT_SIZE, 1056, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
            tabsPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 626,
            Short.MAX_VALUE));

    pack();
}

From source file:uk.ac.ucl.chem.ccs.clinicalgui.DisplayJobPanel.java

private void initGUI() {
    if (ajo == null) {
        try {//from   w  ww .j a va 2 s. c  om
            setPreferredSize(new Dimension(400, 300));
        } catch (Exception e) {
            e.printStackTrace();
        }
        //JLabel l = new JLabel("No simulation running");
        //this.add(l);
        //this.setEnabled(false);
        return;
    }
    System.out.println("I am not null: drawing the display job panel");
    try {
        TableLayout thisLayout = new TableLayout(new double[][] { { TableLayout.FILL }, { TableLayout.PREFERRED,
                TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL, TableLayout.FILL } });
        thisLayout.setHGap(5);
        thisLayout.setVGap(5);
        this.setLayout(thisLayout);

        {
            jPanel1 = new JPanel();
            TableLayout jPanel1Layout = new TableLayout(new double[][] {
                    { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.PREFERRED,
                            TableLayout.PREFERRED },
                    { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                            TableLayout.FILL } });

            jPanel1Layout.setHGap(5);
            jPanel1Layout.setVGap(5);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1.setLayout(jPanel1Layout);

            jPanel1.setBorder(BorderFactory.createEtchedBorder());
            this.add(jPanel1, "0, 0, 0, 2");
            jPanel1.setPreferredSize(new java.awt.Dimension(630, 305));
            jPanel1.setSize(630, 305);
            {
                dtails = new JPanel();
                GridLayout dtailsLayout = new GridLayout(1, 1);
                dtailsLayout.setColumns(1);
                dtailsLayout.setHgap(5);
                dtailsLayout.setVgap(5);
                dtails.setBorder(BorderFactory.createTitledBorder("Job Details"));
                jPanel1.add(dtails, "0,  0,  2,  4");
                dtails.setLayout(dtailsLayout);
                {
                    jobDetailsSP = new JScrollPane();
                    dtails.add(jobDetailsSP);
                    {
                        jPanel3 = new JPanel();
                        TableLayout jPanel3Layout = new TableLayout(
                                new double[][] { { TableLayout.PREFERRED, TableLayout.FILL },
                                        { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                                TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                        jPanel3Layout.setHGap(5);
                        jPanel3Layout.setVGap(5);
                        jPanel3.setLayout(jPanel3Layout);
                        jobDetailsSP.setViewportView(jPanel3);
                        jPanel3.setBackground(new java.awt.Color(156, 199, 219));
                        {
                            jLabel2 = new JLabel();
                            jPanel3.add(jLabel2, "0, 0");
                            jLabel2.setText("Job Start Time");
                        }
                        {
                            jLabel3 = new JLabel();
                            jPanel3.add(jLabel3, "0, 1");
                            jLabel3.setText("Resource ID");
                        }
                        {
                            jLabel4 = new JLabel();
                            jPanel3.add(jLabel4, "0, 2");
                            jLabel4.setText("Job Type");
                        }
                        {
                            jLabel5 = new JLabel();
                            jPanel3.add(jLabel5, "0, 3");
                            jLabel5.setText("Status");
                        }
                        {
                            jLabel6 = new JLabel();
                            jPanel3.add(jLabel6, "0, 4");
                            jLabel6.setText("Machine");
                        }
                        {
                            jLabel7 = new JLabel();
                            jPanel3.add(jLabel7, "0, 5");
                            jLabel7.setText("CPUs Requested");
                        }
                        {
                            jLabel8 = new JLabel();
                            jPanel3.add(jLabel8, "0, 6");
                            jLabel8.setText("Configuration File");
                        }
                        {
                            jLabel9 = new JLabel();
                            jPanel3.add(jLabel9, "0, 7");
                            jLabel9.setText("Job Arguments");
                        }
                        {
                            jLabel10 = new JLabel();
                            jPanel3.add(jLabel10, "0, 8");
                            jLabel10.setText("Job Stdout");
                        }
                        {
                            jLabel11 = new JLabel();
                            jPanel3.add(jLabel11, "0, 9");
                            jLabel11.setText("Job Stderr");
                        }
                        {
                            jLabel12 = new JLabel();
                            jPanel3.add(jLabel12, "0, 10");
                            jLabel12.setText("Job Stdin");
                        }
                        {
                            jLabel13 = new JLabel();
                            jPanel3.add(jLabel13, "0, 11");
                            jLabel13.setText("Resource Endpoint");
                        }
                        {
                            jobName = new JTextField();
                            jPanel3.add(jobName, "1, 0");
                            jobName.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobName.setOpaque(true);
                            jobName.setBackground(new java.awt.Color(255, 255, 255));
                            jobName.setEditable(false);

                        }
                        {
                            resourceID = new JTextField();
                            jPanel3.add(resourceID, "1, 1");
                            resourceID.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            resourceID.setOpaque(true);
                            resourceID.setBackground(new java.awt.Color(255, 255, 255));
                            resourceID.setEditable(false);

                        }
                        {
                            jobType = new JTextField();
                            jPanel3.add(jobType, "1, 2");
                            jobType.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobType.setBackground(new java.awt.Color(255, 255, 255));
                            jobType.setOpaque(true);
                            jobType.setEditable(false);

                        }
                        {
                            jobStatus = new JLabel();
                            jPanel3.add(jobStatus, "1, 3");
                            jobStatus.setOpaque(true);
                            jobStatus.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStatus.setBackground(new java.awt.Color(255, 255, 255));
                        }
                        {
                            rm = new JTextField();
                            jPanel3.add(rm, "1, 4");
                            rm.setBackground(new java.awt.Color(255, 255, 255));
                            rm.setOpaque(true);
                            rm.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            rm.setEditable(false);

                        }
                        {
                            jobCpus = new JTextField();
                            jPanel3.add(jobCpus, "1, 5");
                            jobCpus.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobCpus.setOpaque(true);
                            jobCpus.setBackground(new java.awt.Color(255, 255, 255));
                            jobCpus.setEditable(false);

                        }
                        {
                            jobConf = new JTextField();
                            jPanel3.add(jobConf, "1, 6");
                            jobConf.setBackground(new java.awt.Color(255, 255, 255));
                            jobConf.setOpaque(true);
                            jobConf.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobConf.setEditable(false);

                        }
                        {
                            jobArgs = new JTextField();
                            jPanel3.add(jobArgs, "1, 7");
                            jobArgs.setBackground(new java.awt.Color(255, 255, 255));
                            jobArgs.setOpaque(true);
                            jobArgs.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobArgs.setEditable(false);

                        }
                        {
                            jobSdtout = new JTextField();
                            jPanel3.add(jobSdtout, "1, 8");
                            jobSdtout.setBackground(new java.awt.Color(255, 255, 255));
                            jobSdtout.setOpaque(true);
                            jobSdtout.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobSdtout.setEditable(false);

                        }
                        {
                            jobStderr = new JTextField();
                            jPanel3.add(jobStderr, "1, 9");
                            jobStderr.setBackground(new java.awt.Color(255, 255, 255));
                            jobStderr.setOpaque(true);
                            jobStderr.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStderr.setEditable(false);

                        }
                        {
                            jobStdin = new JTextField();
                            jPanel3.add(jobStdin, "1, 10");
                            jobStdin.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobStdin.setBackground(new java.awt.Color(255, 255, 255));
                            jobStdin.setOpaque(true);
                            jobStdin.setEditable(false);

                        }
                        {
                            jobEPR = new JTextField();
                            jPanel3.add(jobEPR, "1, 11");
                            jobEPR.setOpaque(true);
                            jobEPR.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                            jobEPR.setBackground(new java.awt.Color(255, 255, 255));
                            jobEPR.setEditable(false);

                        }
                    }

                }
            }
            {
                controls = new JPanel();
                TableLayout controlsLayout = new TableLayout(new double[][] { { TableLayout.FILL },
                        { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                controlsLayout.setHGap(5);
                controlsLayout.setVGap(5);
                controls.setLayout(controlsLayout);
                controls.setBorder(BorderFactory.createTitledBorder("Operations"));
                jPanel1.add(controls, "3,  0,  4,  2");
                {
                    updateStatus = new JButton();
                    controls.add(updateStatus, "0, 0");
                    updateStatus.setText("Update Job Status");
                    updateStatus.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            if (updateStatus.getText().equals("Start Job")) {
                                StartCall sc = new StartCall(ajo,
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-lifetime"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-port"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-dn"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-server"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-pw"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.myproxy-un"));
                                ajo = sc.makeCall();
                                updatePanel();
                            } else {
                                pollJobState();
                            }
                        }
                    });
                }
                {
                    teminateJob = new JButton();
                    controls.add(teminateJob, "0, 1");
                    teminateJob.setText("Terminate Job");
                    teminateJob.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            TerminateSimCall tsc = new TerminateSimCall(ajo.getEndPoint());
                            DisplayJobPanel.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
                            boolean tcsstatus = tsc.makeCall();
                            DisplayJobPanel.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                            if (tcsstatus) {
                                ajo.setState(AHEJobObject.GRIDSAM_TERMINATING);
                                updateState();
                            } else {
                                ErrorMessage em = new ErrorMessage(DisplayJobPanel.this,
                                        "Error terminating job. Check log for details");
                                ;
                            }
                        }
                    });
                }
                {
                    vizButton = new JButton();
                    controls.add(vizButton, "0, 2");
                    vizButton.setText("Visualize");

                    vizButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            String h = "localhost";
                            int p = 65250;
                            int w = 1024 * 1024;

                            VizSteererWindow vs = new VizSteererWindow(h, p, w,
                                    (JFrame) DisplayJobPanel.this.getTopLevelAncestor());
                        }
                    });
                }

                {
                    deleteFiles = new JCheckBox();
                    controls.add(deleteFiles, "0, 3");
                    deleteFiles.setText("Delete staged files when destroying job");
                    deleteFiles.setFont(new java.awt.Font("Sansserif", 0, 11));
                    deleteFiles.setSelected(true);
                }
            }
            {
                polling = new JPanel();
                GridBagLayout pollingLayout = new GridBagLayout();
                pollingLayout.rowWeights = new double[] { 0.1, 0.1, 0.1, 0.1 };
                pollingLayout.rowHeights = new int[] { 7, 7, 7, 7 };
                pollingLayout.columnWeights = new double[] { 0.0, 0.1 };
                pollingLayout.columnWidths = new int[] { 109, 7 };
                polling.setBorder(BorderFactory.createTitledBorder("Status Polling"));
                jPanel1.add(polling, "3,  3,  4,  4");
                polling.setLayout(pollingLayout);
                {
                    jLabel1 = new JLabel();
                    polling.add(jLabel1,
                            new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST,
                                    GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    jLabel1.setText("Set the polling interval ");
                    jLabel1.setFont(new java.awt.Font("Sansserif", 0, 11));
                }
                {
                    jSlider1 = new JSlider();
                    polling.add(jSlider1,
                            new GridBagConstraints(0, 1, 2, 2, 0.0, 0.0, GridBagConstraints.NORTHWEST,
                                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                    jSlider1.setMaximum(60);
                    jSlider1.setValue(0);
                    //jSlider1.setMinorTickSpacing(1);
                    //jSlider1.createStandardLabels(5);
                    Hashtable lab = new Hashtable();
                    lab.put(new Integer(0), new JLabel("0"));
                    lab.put(new Integer(20), new JLabel("10"));
                    lab.put(new Integer(40), new JLabel("20"));
                    lab.put(new Integer(60), new JLabel("30"));
                    jSlider1.setLabelTable(lab);

                    jSlider1.setPaintTicks(true);
                    jSlider1.setPaintLabels(true);
                    jSlider1.setSnapToTicks(false);
                    jSlider1.setMajorTickSpacing(2);
                    jSlider1.setFont(new java.awt.Font("Sansserif", 0, 11));
                    jSlider1.addChangeListener(new ChangeListener() {
                        public void stateChanged(ChangeEvent e) {
                            if (jSlider1.getValue() != 0) {
                                Integer i = new Integer(jSlider1.getValue());
                                time1.setText(Float.toString(i.floatValue() / 2));
                                if (pollingButton.getText().equals("Stop Polling")) {
                                    pollTimer.stop();

                                    pollTimer.setInitialDelay(jSlider1.getValue() * 30000);
                                    pollTimer.setDelay(jSlider1.getValue() * 30000);
                                    pollTimer.start();
                                }
                            } else {
                                if (pollingButton.getText().equals("Stop Polling")) {
                                    pollTimer.stop();
                                    pollingButton.setText("Start Polling");
                                }
                                time1.setText("0.0");
                            }
                        }
                    });
                }
                {
                    pollingButton = new JButton();
                    polling.add(pollingButton,
                            new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTHEAST,
                                    GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    pollingButton.setText("Start Polling");
                    pollingButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent evt) {
                            if (jSlider1.getValue() > 0) {
                                if (pollingButton.getText().equals("Start Polling")) {
                                    pollTimer = new Timer(jSlider1.getValue() * 30000, new ActionListener() {
                                        public void actionPerformed(ActionEvent evt) {
                                            pollJobState();
                                        }
                                    });
                                    pollTimer.setInitialDelay(1);
                                    pollTimer.start();
                                    pollingButton.setText("Stop Polling");
                                } else {
                                    pollTimer.stop();
                                    pollingButton.setText("Start Polling");
                                }
                            }
                        }
                    });

                }
                {
                    time = new JLabel();
                    polling.add(time, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    time.setBackground(new java.awt.Color(255, 255, 255));
                    time.setText("Every");
                }
                {
                    jLabel14 = new JLabel();
                    polling.add(jLabel14, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    jLabel14.setText("mins");
                }
                {
                    time1 = new JLabel();
                    polling.add(time1, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                            GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
                    time1.setText("0.0");
                    ;
                }
            }
        }
        {
            jPanel2 = new JPanel();
            GridLayout jPanel2Layout = new GridLayout(1, 1);
            jPanel2Layout.setColumns(1);
            jPanel2Layout.setHgap(5);
            jPanel2Layout.setVgap(5);
            jPanel2.setLayout(jPanel2Layout);
            TitledBorder title2;
            title2 = BorderFactory.createTitledBorder("Job Output");
            jPanel2.setBorder(title2);
            this.add(jPanel2, "0, 3, 0, 4");
            jPanel2.setPreferredSize(new java.awt.Dimension(630, 254));
            {
                jTabbedPane1 = new JTabbedPane();
                jPanel2.add(jTabbedPane1);

                {
                    gridsamStatus = new JPanel();
                    GridLayout gridsamStatusLayout = new GridLayout(1, 1);
                    gridsamStatusLayout.setColumns(1);
                    gridsamStatusLayout.setHgap(5);
                    gridsamStatusLayout.setVgap(5);
                    gridsamStatus.setLayout(gridsamStatusLayout);
                    jTabbedPane1.addTab("AHE Job Status", null, gridsamStatus, null);
                    {
                        jScrollPane1 = new JScrollPane();
                        gridsamStatus.add(jScrollPane1);
                        {
                            gridsamStatusResults = new JTextArea();
                            jScrollPane1.setViewportView(gridsamStatusResults);
                            gridsamStatusResults.setFont(new java.awt.Font("Monospaced", 0, 12));
                        }
                    }
                }
                {
                    stagedFiles = new JPanel();
                    TableLayout stagedFilesLayout = new TableLayout(new double[][] {
                            { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                    TableLayout.PREFERRED, TableLayout.PREFERRED },
                            { TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL,
                                    TableLayout.FILL, TableLayout.PREFERRED } });
                    stagedFilesLayout.setHGap(5);
                    stagedFilesLayout.setVGap(5);
                    stagedFiles.setLayout(stagedFilesLayout);
                    jTabbedPane1.addTab("Staged Files", null, stagedFiles, null);
                    {
                        filesScrollPane = new JScrollPane();
                        stagedFiles.add(filesScrollPane, "0, 0, 5, 4");
                        {

                            outputFilesTable = new JTable();

                            int col1 = 0, col2 = 0;
                            int fsize = outputFilesTable.getFont().getSize() - 5;
                            Object data[][] = new Object[ajo.getOutfiles().size() + ajo.getInfiles().size()][3];

                            int i = 0;
                            if (ajo.getOutfiles() != null) {
                                Iterator it = ajo.getOutfiles().iterator();
                                while (it.hasNext()) {
                                    JobFileElement je = (JobFileElement) it.next();
                                    data[i][0] = new Boolean(true);
                                    data[i][1] = je.getName();
                                    if (je.getName().length() > col1) {
                                        col1 = je.getName().length();
                                    }
                                    String url = Tools.getUrlNoUP(je.getRemotepath());
                                    data[i][2] = url;
                                    if (url.length() > col2) {
                                        col2 = url.length();
                                    }
                                    i++;
                                }
                            }

                            if (ajo.getInfiles() != null) {
                                Iterator it = ajo.getInfiles().iterator();
                                while (it.hasNext()) {
                                    JobFileElement je = (JobFileElement) it.next();
                                    data[i][0] = new Boolean(false);
                                    data[i][1] = je.getName();
                                    if (je.getName().length() > col1) {
                                        col1 = je.getName().length();
                                    }
                                    String url = Tools.getUrlNoUP(je.getRemotepath());
                                    data[i][2] = url;
                                    if (url.length() > col2) {
                                        col2 = url.length();
                                    }
                                    i++;
                                }
                            }

                            String colNames[] = { "Download", "File Name", "File Location" };

                            TableModel outputFilesTableModel = new MyTableModel(data, colNames);
                            outputFilesTable.setIntercellSpacing(new Dimension(3, 3));
                            outputFilesTable.setModel(outputFilesTableModel);
                            outputFilesTable.getColumnModel().getColumn(0).setPreferredWidth(70);
                            outputFilesTable.getColumnModel().getColumn(1).setPreferredWidth(col1 * fsize);
                            outputFilesTable.getColumnModel().getColumn(2).setPreferredWidth(col2 * fsize);
                            outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                            filesScrollPane.setViewportView(outputFilesTable);
                            this.addComponentListener(new ComponentAdapter() {
                                public void componentResized(ComponentEvent e) {
                                    if (outputFilesTable.getWidth() < filesScrollPane.getWidth()) {
                                        outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
                                    } else {
                                        outputFilesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                                    }
                                }
                            });

                        }

                    }
                    {
                        downloadButton = new JButton();
                        stagedFiles.add(downloadButton, "5, 5");
                        downloadButton.setText("Download");
                        downloadButton.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                int outFileSize = ajo.getOutfiles().size();
                                for (int row = 0; row < outputFilesTable.getRowCount(); row++) {
                                    if (((Boolean) outputFilesTable.getValueAt(row, 0))
                                            .booleanValue() == true) {

                                        if (row < outFileSize) {
                                            JobFileElement je = (JobFileElement) ajo.getOutfiles()
                                                    .elementAt(row);

                                            if (fileLocation != null) {
                                                je.setLocalpath(Tools.checkURL(fileLocation) + je.getName());
                                            }

                                            downloadFiles.add(je);
                                        } else {
                                            JobFileElement je = (JobFileElement) ajo.getInfiles()
                                                    .elementAt(row - outFileSize);

                                            if (fileLocation != null) {
                                                je.setLocalpath(Tools.checkURL(fileLocation) + je.getName());
                                            }

                                            downloadFiles.add(je);
                                        }
                                    }

                                }

                                StageFilesIn task = new StageFilesIn(
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavserver"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavuser"),
                                        ClinicalGuiClient.prop
                                                .getProperty("uk.ac.ucl.chem.ccs.aheclient.ahedavpasswd"));
                                task.init(downloadFiles);

                                ProgressMonitor progressMonitor = new ProgressMonitor(DisplayJobPanel.this,
                                        "Downloading Files", null, 0, task.getLength());
                                //progressMonitor.setMillisToDecideToPopup(1);
                                progressMonitor.setMillisToPopup(100);
                                //jProgressBar1.setMaximum(task.getLength());
                                //jProgressBar1.setValue(0);

                                while (task.filesToStage()) {
                                    if (task.stageNext()) {
                                        progressMonitor.setProgress(task.getCurrent());
                                    } else {
                                        cat.error(task.getError());

                                    }

                                }

                            }
                        });

                    }
                    {
                        changeLocationButton = new JButton();
                        stagedFiles.add(changeLocationButton, "4, 5");
                        changeLocationButton.setText("Local Dir");
                        changeLocationButton.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                JFileChooser fc = new JFileChooser();
                                fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                                int returnVal = fc.showOpenDialog(DisplayJobPanel.this);

                                if (returnVal == JFileChooser.APPROVE_OPTION) {
                                    File file = fc.getSelectedFile();
                                    fileLocation = file.getAbsolutePath();
                                    //System.out.println(fileLocation);
                                }
                            }
                        });

                    }
                }
                {
                    if (ajo.getReGSWSEPR() != null) {

                        regSteering = new JPanel();

                        TableLayout steerLayout = new TableLayout(
                                new double[][] { { TableLayout.FILL }, { TableLayout.FILL, TableLayout.FILL,
                                        TableLayout.FILL, TableLayout.FILL, TableLayout.FILL } });
                        regSteering.setLayout(steerLayout);
                        steeredApp = true;
                        jTabbedPane1.addTab("ReG Steering", null, regSteering, null);
                        {
                            JLabel look = new JLabel("Steering address");
                            steerERP = new JTextField();
                            steer = new JButton("Start Steerer");
                            steer.setEnabled(false);
                            steer.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent evt) {
                                    vs = new VizSteererWindow(h, p, w,
                                            DisplayJobPanel.this.getTopLevelAncestor());
                                }
                            });

                            regSteering.add(look, "0,1");
                            regSteering.add(steerERP, "0,2");
                            regSteering.add(steer, "0,3");

                        }

                    }
                }

            }
        }
        updatePanel();
        this.setPreferredSize(new java.awt.Dimension(630, 605));
        this.setSize(630, 605);
        this.setOpaque(false);

    } catch (Exception e) {
        e.printStackTrace();
    }
}