Example usage for javax.swing JLabel setText

List of usage examples for javax.swing JLabel setText

Introduction

In this page you can find the example usage for javax.swing JLabel setText.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "Defines the single line of text this component will display.")
public void setText(String text) 

Source Link

Document

Defines the single line of text this component will display.

Usage

From source file:com.floreantpos.ui.model.PizzaItemForm.java

private void initComponents() {
    setLayout(new BorderLayout());
    JLabel lblButtonColor = new JLabel(Messages.getString("MenuItemForm.19")); //$NON-NLS-1$
    tabbedPane = new javax.swing.JTabbedPane();

    JPanel tabGeneral = new javax.swing.JPanel();

    JLabel lblName = new JLabel();
    lblName.setHorizontalAlignment(SwingConstants.TRAILING);

    tfName = new com.floreantpos.swing.FixedLengthTextField(20);
    tfDescription = new JTextArea(new FixedLengthDocument(120));

    JLabel lTax = new javax.swing.JLabel();
    lTax.setHorizontalAlignment(SwingConstants.TRAILING);

    cbTax = new javax.swing.JComboBox();
    JButton btnNewTax = new javax.swing.JButton();

    JPanel tabShift = new javax.swing.JPanel();
    JPanel tabPrice = new javax.swing.JPanel();

    JPanel tabButtonStyle = new javax.swing.JPanel();
    JButton btnDeleteShift = new javax.swing.JButton();
    JButton btnAddShift = new javax.swing.JButton();

    JButton btnNewPrice = new javax.swing.JButton();
    JButton btnUpdatePrice = new javax.swing.JButton();
    JButton btnDeletePrice = new javax.swing.JButton();
    JButton btnDeleteAll = new javax.swing.JButton();
    JButton btnDefaultValue = new javax.swing.JButton();
    JButton btnAutoGenerate = new javax.swing.JButton();

    JScrollPane jScrollPane2 = new javax.swing.JScrollPane();
    JScrollPane priceTabScrollPane = new javax.swing.JScrollPane();

    shiftTable = new JTable();

    priceTable = new JTable();
    priceTable.setRowHeight(PosUIManager.getSize(priceTable.getRowHeight()));
    priceTable.setCellSelectionEnabled(true);
    priceTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    priceTable.setSurrendersFocusOnKeystroke(true);
    cbPrinterGroup = new JComboBox<PrinterGroup>(new DefaultComboBoxModel<PrinterGroup>(
            PrinterGroupDAO.getInstance().findAll().toArray(new PrinterGroup[0])));
    cbPrinterGroup.setPreferredSize(new Dimension(226, 0));

    tfDefaultSellPortion = new IntegerTextField(10);
    tfTranslatedName = new FixedLengthTextField(20);
    tfTranslatedName.setLength(120);/*w  w w  .  jav  a 2  s. co  m*/
    lblKitchenPrinter = new JLabel(Messages.getString("MenuItemForm.27")); //$NON-NLS-1$
    lblName.setText(Messages.getString("LABEL_NAME")); //$NON-NLS-1$
    tfName.setLength(120);
    JLabel lblTranslatedName = new JLabel(Messages.getString("MenuItemForm.lblTranslatedName.text")); //$NON-NLS-1$
    tfSortOrder = new IntegerTextField(20);
    tfSortOrder.setText(""); //$NON-NLS-1$
    cbTax.setPreferredSize(new Dimension(198, 0));
    btnButtonColor = new JButton(); //$NON-NLS-1$
    btnButtonColor.setPreferredSize(new Dimension(228, 40));
    JLabel lblTextColor = new JLabel(Messages.getString("MenuItemForm.lblTextColor.text")); //$NON-NLS-1$
    btnTextColor = new JButton(Messages.getString("MenuItemForm.SAMPLE_TEXT")); //$NON-NLS-1$
    cbShowTextWithImage = new JCheckBox(Messages.getString("MenuItemForm.40")); //$NON-NLS-1$
    cbShowTextWithImage.setActionCommand(Messages.getString("MenuItemForm.41")); //$NON-NLS-1$
    lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$
    btnNewTax.setText("...");
    lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$

    btnNewTax.setText("..."); //$NON-NLS-1$
    btnNewTax.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnNewTaxdoCreateNewTax(evt);
        }
    });

    tabbedPane.addTab(com.floreantpos.POSConstants.GENERAL, tabGeneral);
    tabbedPane.setPreferredSize(new Dimension(750, 470));

    tabbedPane.addTab(com.floreantpos.POSConstants.MODIFIER_GROUPS, getModifierGroupTab());

    btnAddShift.addActionListener(this);
    btnDeleteShift.addActionListener(this);

    tabGeneral.setLayout(new MigLayout("insets 20", "[][]20px[][]", "[][][][][][][][][][][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    tabGeneral.add(lblName, "cell 0 1 ,right"); //$NON-NLS-1$
    tabGeneral.add(tfName, "cell 1 1,grow"); //$NON-NLS-1$

    tabGeneral.add(lblTranslatedName, "cell 0 2,right"); //$NON-NLS-1$
    tabGeneral.add(tfTranslatedName, "cell 1 2,grow");

    JLabel lgroup = new javax.swing.JLabel();
    lgroup.setHorizontalAlignment(SwingConstants.TRAILING);
    lgroup.setText(Messages.getString("LABEL_GROUP")); //$NON-NLS-1$

    tabGeneral.add(lgroup, "cell 0 3,alignx right"); //$NON-NLS-1$
    JLabel lblBarcode = new JLabel(Messages.getString("MenuItemForm.lblBarcode.text")); //$NON-NLS-1$

    tabGeneral.add(lblBarcode, "cell 0 4,alignx right"); //$NON-NLS-1$
    tfBarcode = new FixedLengthTextField(20);
    tabGeneral.add(tfBarcode, "cell 1 4,grow"); //$NON-NLS-1$
    JLabel lblStockCount = new JLabel(Messages.getString("MenuItemForm.17")); //$NON-NLS-1$

    tabGeneral.add(lblStockCount, "cell 0 5,alignx right"); //$NON-NLS-1$
    tfStockCount = new DoubleTextField(1);
    tabGeneral.add(tfStockCount, "cell 1 5,grow"); //$NON-NLS-1$
    chkVisible = new javax.swing.JCheckBox();

    tabGeneral.add(new JLabel("Default sell portion (%)"), "cell 0 6");
    tabGeneral.add(tfDefaultSellPortion, "cell 1 6,grow");

    chkVisible.setText(com.floreantpos.POSConstants.VISIBLE);
    chkVisible.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    chkVisible.setMargin(new java.awt.Insets(0, 0, 0, 0));

    tabGeneral.add(chkVisible, "cell 1 7");
    tabGeneral.add(lblKitchenPrinter, "cell 2 1,right"); //$NON-NLS-1$
    tabGeneral.add(cbPrinterGroup, "cell 3 1,grow"); //$NON-NLS-1$

    tabGeneral.add(lTax, "cell 2 2,right"); //$NON-NLS-1$
    tabGeneral.add(cbTax, "cell 3 2"); //$NON-NLS-1$
    tabGeneral.add(btnNewTax, "cell 3 2,grow"); //$NON-NLS-1$

    cbGroup = new javax.swing.JComboBox();
    cbGroup.setPreferredSize(new Dimension(198, 0));

    tabGeneral.add(cbGroup, "flowx,cell 1 3"); //$NON-NLS-1$
    JButton btnNewGroup = new javax.swing.JButton();

    btnNewGroup.setText("..."); //$NON-NLS-1$
    btnNewGroup.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            doCreateNewGroup(evt);
        }
    });
    tabGeneral.add(btnNewGroup, "cell 1 3"); //$NON-NLS-1$

    tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.25")), "cell 2 3,right"); //$NON-NLS-1$ //$NON-NLS-2$
    orderList = new CheckBoxList();

    List<OrderType> orderTypes = Application.getInstance().getOrderTypes();
    orderList.setModel(orderTypes);

    JScrollPane orderCheckBoxList = new JScrollPane(orderList);
    orderCheckBoxList.setPreferredSize(new Dimension(228, 100));
    tabGeneral.add(orderCheckBoxList, "cell 3 3 3 3"); //$NON-NLS-1$
    cbDisableStockCount = new JCheckBox(Messages.getString("MenuItemForm.18")); //$NON-NLS-1$
    tabGeneral.add(cbDisableStockCount, "cell 1 8"); //$NON-NLS-1$

    tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.29")), "cell 2 6,alignx right"); //$NON-NLS-1$ //$NON-NLS-2$
    JScrollPane scrlDescription = new JScrollPane(tfDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrlDescription.setPreferredSize(new Dimension(228, 70));
    tfDescription.setLineWrap(true);
    tabGeneral.add(scrlDescription, "cell 3 6 3 3"); //$NON-NLS-1$

    add(tabbedPane);
    //TODO: 
    addRecepieExtension();

    btnDeleteShift.setText(com.floreantpos.POSConstants.DELETE_SHIFT);
    btnAddShift.setText(com.floreantpos.POSConstants.ADD_SHIFT);

    shiftTable
            .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" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    jScrollPane2.setViewportView(shiftTable);

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(tabShift);
    tabShift.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel3Layout.createSequentialGroup().addContainerGap(76, Short.MAX_VALUE)
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 670,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                            jPanel3Layout.createSequentialGroup().add(btnAddShift).add(5, 5, 5)
                                                    .add(btnDeleteShift)))
                            .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 345,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(btnAddShift).add(btnDeleteShift))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    tabbedPane.addTab(com.floreantpos.POSConstants.SHIFTS, tabShift);

    btnNewPrice.setText(Messages.getString("MenuItemForm.9")); //$NON-NLS-1$
    btnNewPrice.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            addNewPrice();
        }
    });
    btnUpdatePrice.setText(Messages.getString("MenuItemForm.13")); //$NON-NLS-1$
    btnUpdatePrice.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            updatePrice();
        }
    });
    btnDeletePrice.setText(Messages.getString("MenuItemForm.14")); //$NON-NLS-1$
    btnDeletePrice.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            deletePrice();
        }
    });

    btnAutoGenerate.setText("Auto Generate"); //$NON-NLS-1$
    btnAutoGenerate.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            autoGeneratePizzaItemSizeAndPrice();
        }
    });

    btnDeleteAll.setText(Messages.getString("MenuItemForm.15")); //$NON-NLS-1$
    btnDeleteAll.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            deleteAll();
        }
    });

    btnDefaultValue.setText(Messages.getString("MenuItemForm.7")); //$NON-NLS-1$
    priceTabScrollPane.setViewportView(priceTable);

    tabPrice.setLayout(new BorderLayout());
    tabPrice.add(priceTabScrollPane, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();

    buttonPanel.add(btnNewPrice);
    buttonPanel.add(btnUpdatePrice);
    buttonPanel.add(btnDeletePrice);
    buttonPanel.add(btnAutoGenerate);

    tabPrice.add(buttonPanel, BorderLayout.SOUTH);
    tabGeneral.add(tabPrice, "cell 0 10,grow,span");
    tabbedPane.addChangeListener(this);

    tabButtonStyle.setLayout(new MigLayout("insets 10", "[][]100[][][][]", "[][][center][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    JLabel lblImage = new JLabel(Messages.getString("MenuItemForm.28")); //$NON-NLS-1$
    lblImage.setHorizontalAlignment(SwingConstants.TRAILING);
    tabButtonStyle.add(lblImage, "cell 0 0,right"); //$NON-NLS-1$

    lblImagePreview = new JLabel(""); //$NON-NLS-1$
    lblImagePreview.setHorizontalAlignment(JLabel.CENTER);
    lblImagePreview.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    lblImagePreview.setPreferredSize(new Dimension(100, 100));
    tabButtonStyle.add(lblImagePreview, "cell 1 0"); //$NON-NLS-1$

    JButton btnSelectImage = new JButton("..."); //$NON-NLS-1$
    btnClearImage = new JButton(Messages.getString("MenuItemForm.34")); //$NON-NLS-1$
    tabButtonStyle.add(btnClearImage, "cell  1 0"); //$NON-NLS-1$
    tabButtonStyle.add(btnSelectImage, "cell 1 0"); //$NON-NLS-1$

    tabButtonStyle.add(lblButtonColor, "cell 0 2,right"); //$NON-NLS-1$
    tabButtonStyle.add(btnButtonColor, "cell 1 2,grow"); //$NON-NLS-1$
    tabButtonStyle.add(lblTextColor, "cell 0 3,right"); //$NON-NLS-1$
    tabButtonStyle.add(btnTextColor, "cell 1 3"); //$NON-NLS-1$
    tabButtonStyle.add(cbShowTextWithImage, "cell 1 4"); //$NON-NLS-1$

    btnTextColor.setPreferredSize(new Dimension(228, 50));

    btnSelectImage.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            doSelectImageFile();
        }
    });

    btnClearImage.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            doClearImage();
        }
    });

    btnButtonColor.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Color color = JColorChooser.showDialog(POSUtil.getBackOfficeWindow(),
                    Messages.getString("MenuItemForm.42"), btnButtonColor.getBackground()); //$NON-NLS-1$
            btnButtonColor.setBackground(color);
            btnTextColor.setBackground(color);
        }
    });

    btnTextColor.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Color color = JColorChooser.showDialog(POSUtil.getBackOfficeWindow(),
                    Messages.getString("MenuItemForm.43"), btnTextColor.getForeground()); //$NON-NLS-1$
            btnTextColor.setForeground(color);
        }
    });

    tabbedPane.addTab(Messages.getString("MenuItemForm.26"), tabButtonStyle); //$NON-NLS-1$
}

From source file:semaforo.Semaforo.java

public void calculoColorPorcentajeGroups(JLabel label, double porcentajeD) {
    int porcentaje = 0;
    if (porcentajeD != 0)
        porcentaje = (int) ((int) 100 - porcentajeD);
    if (porcentaje < 0) {
        label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/semaforo/resources/verde-c.png")));
        porcentaje = 0;//from   w w  w . jav  a2s  .c o  m
    }
    label.setText(porcentaje + "%");
    if (porcentaje >= 0 && porcentaje <= 50) {
        label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/semaforo/resources/verde-c.png")));
    }
    if (porcentaje >= 51 && porcentaje <= 75) {
        label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/semaforo/resources/amarillo-c.png")));
    }
    if (porcentaje >= 76) {
        label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/semaforo/resources/rojo-c.png")));
    }
}

From source file:self.philbrown.javaQuery.$.java

/**
 * Include the html string the selected views. If a view has a setText method, it is used. Otherwise,
 * a new TextView is created. This html can also handle image tags for both urls and local files.
 * Local files should be the name (for example, for R.id.ic_launcher, just use ic_launcher).
 * @param html the HTML String to include
 *///from  w ww  . j  a  v  a  2 s.c  om
public $ html(String html) {
    for (Component view : this.views) {
        try {
            Method m = view.getClass().getMethod("setText", new Class<?>[] { String.class });
            m.invoke(view, html);
        } catch (Throwable t) {
            if (view instanceof Container) {
                try {
                    //no setText method. Try a TextView
                    JLabel label = new JLabel();
                    int rgba = Color.HSBtoRGB(0, 0, 0);
                    rgba |= (0 & 0xff);
                    label.setBackground(new Color(rgba, true));
                    label.setBounds(label.getParent().getBounds());
                    ((Container) view).add(label);
                    label.setText(html);
                } catch (Throwable t2) {
                    //unable to set content
                    Log.w("javaQuery", "unable to set HTML content");
                }
            } else {
                //unable to set content
                Log.w("javaQuery", "unable to set textual content");
            }
        }
    }

    return this;
}

From source file:self.philbrown.javaQuery.$.java

/**
 * Includes the given text string inside of the selected views. If a view has a setText method, it is used
 * otherwise, if possible, a textview is added as a child to display the text.
 * @param text the text to include//from   ww  w . ja v  a  2 s.c om
 */
public $ text(String text) {
    for (Component view : this.views) {
        try {
            Method m = view.getClass().getMethod("setText", new Class<?>[] { String.class });
            m.invoke(view, text);
        } catch (Throwable t) {
            if (view instanceof Container) {
                try {
                    //no setText method. Try a TextView
                    JLabel label = new JLabel();
                    int rgba = Color.HSBtoRGB(0, 0, 0);
                    rgba |= (0 & 0xff);
                    label.setBackground(new Color(rgba, true));
                    label.setBounds(label.getParent().getBounds());
                    ((Container) view).add(label);
                    label.setText(text);
                } catch (Throwable t2) {
                    //unable to set content
                    Log.w("javaQuery", "unable to set textual content");
                }
            } else {
                //unable to set content
                Log.w("javaQuery", "unable to set textual content");
            }
        }
    }

    return this;
}

From source file:CSSDFarm.UserInterface.java

private void btnAddFieldStationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddFieldStationActionPerformed
    JTextField id = new JTextField();
    JTextField name = new JTextField();
    //Space is needed to expand dialog
    JLabel verified = new JLabel(" ");
    JButton okButton = new JButton("Ok");
    JButton cancelButton = new JButton("Cancel");
    okButton.setEnabled(false);// www  .ja va  2s.  co  m
    okButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            String idText = id.getText();
            String nameText = name.getText();
            addFieldStation(id.getText(), name.getText());
            JOptionPane.getRootFrame().dispose();
            listUserStations.setSelectedValue(server.getFieldStation(idText), false);
        }
    });

    cancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            JOptionPane.getRootFrame().dispose();
        }
    });

    id.addKeyListener(new KeyAdapter() {
        public void keyReleased(KeyEvent key) {
            boolean theid = id.getText().equals("");
            boolean thename = name.getText().equals("");
            if (server.verifyFieldStation(id.getText()) && !theid && !thename) {
                verified.setText(" Verified");
                verified.setForeground(new Color(0, 102, 0));
                okButton.setEnabled(true);
            } else {
                verified.setText(" Not Verified");
                verified.setForeground(Color.RED);
                okButton.setEnabled(false);
            }
        }
    });
    name.addKeyListener(new KeyAdapter() {
        public void keyReleased(KeyEvent key) {
            boolean theid = id.getText().equals("");
            boolean thename = name.getText().equals("");
            if (server.verifyFieldStation(id.getText()) && !theid && !thename) {
                verified.setText(" Verified");
                verified.setForeground(new Color(0, 102, 0));
                okButton.setEnabled(true);
            } else {
                verified.setText(" Not Verified");
                verified.setForeground(Color.RED);
                okButton.setEnabled(false);
            }
        }
    });

    Object[] message = { "Field Station ID:", id, "Field Station Name:", name, verified };
    int inputFields = JOptionPane.showOptionDialog(null, message, "Add Field Station",
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,
            new Object[] { okButton, cancelButton }, null);
    if (inputFields == JOptionPane.OK_OPTION) {
        System.out.print("Added Field Station!");
    }
}

From source file:edu.ku.brc.specify.Specify.java

/**
 * General Method for initializing the class
 *
 *//*from w w  w.ja v a2s .c  o m*/
private void initialize(final GraphicsConfiguration gc) {
    setLayout(new BorderLayout());

    // set the preferred size of the demo
    setPreferredSize(new Dimension(PREFERRED_WIDTH, PREFERRED_HEIGHT));
    setPreferredSize(new Dimension(1024, 768)); // For demo

    topFrame = new JFrame(gc);
    topFrame.setIconImage(IconManager.getImage(getIconName()).getImage()); //$NON-NLS-1$
    //topFrame.setAlwaysOnTop(true);

    topFrame.setGlassPane(glassPane = GhostGlassPane.getInstance());
    topFrame.setLocationRelativeTo(null);
    Toolkit.getDefaultToolkit().setDynamicLayout(true);
    UIRegistry.register(UIRegistry.GLASSPANE, glassPane);

    // Don't check everytime, too annoying
    //AppPreferences.getLocalPrefs().remove("SYSTEM.HasOpenGL"); // clear prop so it is checked
    UIHelper.checkForOpenGL();

    JPanel top = new JPanel();
    top.setLayout(new BorderLayout());
    add(top, BorderLayout.NORTH);

    UIRegistry.setTopWindow(topFrame);

    menuBar = createMenus();
    if (menuBar != null) {
        topFrame.setJMenuBar(menuBar);
    }
    UIRegistry.register(UIRegistry.MENUBAR, menuBar);

    JToolBar toolBar = createToolBar();
    if (toolBar != null) {
        top.add(toolBar, BorderLayout.CENTER);
    }
    UIRegistry.register(UIRegistry.TOOLBAR, toolBar);

    mainPanel = new MainPanel();

    int[] sections = { 5, 5, 5, 1 };
    statusField = new JStatusBar(sections);
    statusField.setErrorIcon(IconManager.getIcon("Error", IconManager.IconSize.Std16)); //$NON-NLS-1$
    statusField.setWarningIcon(IconManager.getIcon("Warning", IconManager.IconSize.Std16)); //$NON-NLS-1$
    UIRegistry.setStatusBar(statusField);

    JLabel secLbl = statusField.getSectionLabel(3);
    if (secLbl != null) {
        boolean isSecurityOn = AppContextMgr.isSecurityOn();
        secLbl.setIcon(
                IconManager.getImage(isSecurityOn ? "SecurityOn" : "SecurityOff", IconManager.IconSize.Std16));
        secLbl.setHorizontalAlignment(SwingConstants.CENTER);
        secLbl.setHorizontalTextPosition(SwingConstants.LEFT);
        secLbl.setText("");
        secLbl.setToolTipText(getResourceString("Specify.SEC_" + (isSecurityOn ? "ON" : "OFF")));
    }

    add(statusField, BorderLayout.SOUTH);

}

From source file:com.diversityarrays.kdxplore.curate.TrialDataEditor.java

private void updateRowFilter() {

    @SuppressWarnings("unchecked")
    TableRowSorter<CurationTableModel> rowSorter = (TableRowSorter<CurationTableModel>) curationTable
            .getRowSorter();//w w w.j  ava 2  s  .c o  m

    onlyRowsWithScores = onlyRowsWithScoresCheckbox.isSelected();

    boolean onlyUneditedBefore = onlyUncurated;
    onlyUncurated = onlyUneditedCheckbox.isSelected();

    @SuppressWarnings("unused")
    boolean hideInactiveBefore = hideInactive;
    hideInactive = hideInactivePlots.isSelected();

    JLabel label = curationTablePanel.separator.getLabel();
    String msg;
    if (isAnyFilterActive()) {
        rowSorter.setRowFilter(plotFilter);
        label.setForeground(Color.RED);
        msg = PHRASE_SHOWING + curationTable.getRowCount() + " of " + curationTableModel.getRowCount();
    } else {
        rowSorter.setRowFilter(null);
        label.setForeground(Color.DARK_GRAY);

        msg = PHRASE_SHOWING_ALL + +curationTable.getRowCount();
    }

    curationTable.setRowSorter(rowSorter);

    if (onlyUneditedBefore != onlyUncurated) {
        curationTableModel.setUsingOnlyUnedited(onlyUncurated);
    }

    // Allow filter to be applied before updating
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            label.setToolTipText(msg);
            label.setText(msg);
        }
    });
}

From source file:com.pianobakery.complsa.MainGui.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/* w w  w . jav  a  2s  . c  om*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    mainPanel = new JPanel();
    mainPanel.setLayout(new FormLayout("fill:max(m;620px):grow", "center:max(m;600px):grow"));
    tabbedPane1 = new JTabbedPane();
    tabbedPane1.setEnabled(true);
    CellConstraints cc = new CellConstraints();
    mainPanel.add(tabbedPane1, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));
    setupPanel = new JPanel();
    setupPanel.setLayout(new FormLayout(
            "fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:126px:noGrow,fill:max(d;4px):noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:5dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:52px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,fill:d:grow,fill:d:grow,fill:66px:noGrow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow"));
    tabbedPane1.addTab("Project", setupPanel);
    newFolderButton = new JButton();
    newFolderButton.setText("New Folder");
    setupPanel.add(newFolderButton, cc.xy(1, 5));
    final JLabel label1 = new JLabel();
    label1.setText("Project Folder:");
    setupPanel.add(label1, cc.xy(1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    selectFolderButton = new JButton();
    selectFolderButton.setText("Select Folder");
    setupPanel.add(selectFolderButton, cc.xy(5, 5));
    wDirText = new JTextField();
    wDirText.setEditable(false);
    wDirText.setText("Create or select Project Folder");
    setupPanel.add(wDirText, cc.xyw(7, 5, 48, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label2 = new JLabel();
    label2.setText("The Project Folder contains all the Project Data.");
    setupPanel.add(label2, cc.xyw(1, 3, 54));
    final JLabel label3 = new JLabel();
    label3.setText("Arrange your Documents in a Folder. Then add it to the Software.");
    setupPanel.add(label3, cc.xyw(1, 15, 54));
    downloadModelButton = new JButton();
    downloadModelButton.setText("Download Models");
    setupPanel.add(downloadModelButton, cc.xy(1, 9));
    final JLabel label4 = new JLabel();
    label4.setText("Language Models:");
    setupPanel.add(label4, cc.xy(5, 9));
    langModelsText = new JLabel();
    langModelsText.setText("");
    setupPanel.add(langModelsText, cc.xyw(7, 9, 48));
    trainCorpButton = new JButton();
    trainCorpButton.setText("Train Semantics");
    setupPanel.add(trainCorpButton, cc.xy(1, 33, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label5 = new JLabel();
    label5.setText("Create Semantic Knowledge with selected Training Corpus:");
    setupPanel.add(label5, cc.xyw(1, 25, 7));
    addTopicCorpusButton = new JButton();
    addTopicCorpusButton.setEnabled(true);
    addTopicCorpusButton.setText(" Add Corpus Folder");
    setupPanel.add(addTopicCorpusButton, cc.xy(1, 19));
    addCorpRecursiveCheckBox = new JCheckBox();
    addCorpRecursiveCheckBox.setSelected(true);
    addCorpRecursiveCheckBox.setText("Recursive");
    setupPanel.add(addCorpRecursiveCheckBox, cc.xy(5, 19));
    createChunksCheckBox = new JCheckBox();
    createChunksCheckBox.setSelected(true);
    createChunksCheckBox.setText("Split in Paragraph of:");
    setupPanel.add(createChunksCheckBox, cc.xy(7, 19));
    final JLabel label6 = new JLabel();
    label6.setText("Add/Remove Training Corpus:");
    setupPanel.add(label6, cc.xyw(1, 17, 5));
    final JLabel label7 = new JLabel();
    label7.setText("Select Training Corpus:");
    setupPanel.add(label7, cc.xyw(1, 21, 54));
    selectTrainCorp = new JComboBox();
    selectTrainCorp.setEnabled(true);
    setupPanel.add(selectTrainCorp, cc.xyw(1, 23, 5));
    removeTopicCorpusButton = new JButton();
    removeTopicCorpusButton.setEnabled(true);
    removeTopicCorpusButton.setHorizontalAlignment(2);
    removeTopicCorpusButton.setText("Remove Training Corpus");
    setupPanel.add(removeTopicCorpusButton, cc.xy(7, 23));
    setupPanel.add(indexTypeComboBox, cc.xy(7, 33));
    amountOfSentencesPerTextField = new JTextField();
    amountOfSentencesPerTextField.setHorizontalAlignment(2);
    amountOfSentencesPerTextField.setText("20");
    setupPanel.add(amountOfSentencesPerTextField,
            cc.xyw(9, 19, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    posIndRadiusTextField = new JTextField();
    posIndRadiusTextField.setHorizontalAlignment(2);
    posIndRadiusTextField.setText("20");
    setupPanel.add(posIndRadiusTextField, cc.xyw(9, 33, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label8 = new JLabel();
    label8.setText("Indextype:");
    setupPanel.add(label8, cc.xy(5, 33, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JLabel label9 = new JLabel();
    label9.setHorizontalAlignment(2);
    label9.setText("Sentences");
    setupPanel.add(label9, cc.xy(15, 19));
    final JLabel label10 = new JLabel();
    label10.setHorizontalAlignment(2);
    label10.setText("Words");
    setupPanel.add(label10, cc.xy(15, 33));
    setupPanel.add(termComboBox, cc.xyw(31, 33, 19));
    final JLabel label11 = new JLabel();
    label11.setText("Termweight:");
    setupPanel.add(label11, cc.xyw(18, 33, 13));
    updateIndexButton = new JButton();
    updateIndexButton.setText("Update Index");
    setupPanel.add(updateIndexButton, cc.xy(1, 29));
    removeIndexButton = new JButton();
    removeIndexButton.setText("Remove Index");
    setupPanel.add(removeIndexButton, cc.xy(5, 29));
    final JLabel label12 = new JLabel();
    label12.setText("Add/Remove Search Corpus:");
    setupPanel.add(label12, cc.xyw(1, 41, 5));
    impSearchCorpButton = new JButton();
    impSearchCorpButton.setText("Add Search Corpus");
    setupPanel.add(impSearchCorpButton, cc.xy(1, 43));
    impSearchCorpRecursiveCheckBox = new JCheckBox();
    impSearchCorpRecursiveCheckBox.setSelected(true);
    impSearchCorpRecursiveCheckBox.setText("Recursive");
    setupPanel.add(impSearchCorpRecursiveCheckBox, cc.xy(5, 43));
    splitSearchCorpCheckBox = new JCheckBox();
    splitSearchCorpCheckBox.setSelected(true);
    splitSearchCorpCheckBox.setText("Split in Paragraph of:");
    setupPanel.add(splitSearchCorpCheckBox, cc.xy(7, 43));
    amountSearchCorpSent = new JTextField();
    amountSearchCorpSent.setHorizontalAlignment(2);
    amountSearchCorpSent.setText("20");
    setupPanel.add(amountSearchCorpSent, cc.xyw(9, 43, 6, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label13 = new JLabel();
    label13.setHorizontalAlignment(2);
    label13.setText("Sentences");
    setupPanel.add(label13, cc.xy(15, 43));
    searchCorpComboBox = new JComboBox();
    setupPanel.add(searchCorpComboBox, cc.xyw(1, 47, 5, CellConstraints.DEFAULT, CellConstraints.TOP));
    removeSearchCorpButton = new JButton();
    removeSearchCorpButton.setText("Remove Search Corpus");
    setupPanel.add(removeSearchCorpButton, cc.xy(7, 47));
    final JLabel label14 = new JLabel();
    label14.setText("Select Search Corpus:");
    setupPanel.add(label14, cc.xyw(1, 45, 5));
    final JLabel label15 = new JLabel();
    label15.setText("Arrange your Search Corpus in a Folder. Then add it to the Software. ");
    setupPanel.add(label15, cc.xyw(1, 39, 54));
    final JLabel label16 = new JLabel();
    label16.setText("First update the Index.");
    setupPanel.add(label16, cc.xyw(1, 27, 5));
    final JLabel label17 = new JLabel();
    label17.setText(
            "Then select an Algorithm and train the Software. On the Search Tab you can select the Algorithms to run your semantic searches.");
    setupPanel.add(label17, cc.xyw(1, 31, 54));
    final JLabel label18 = new JLabel();
    label18.setText("Download Language Models:");
    setupPanel.add(label18, cc.xyw(1, 7, 54));
    final JLabel label19 = new JLabel();
    label19.setText("Training Corpora:");
    setupPanel.add(label19, cc.xyw(1, 13, 54));
    final JLabel label20 = new JLabel();
    label20.setText("Search Corpora:");
    setupPanel.add(label20, cc.xyw(1, 37, 54));
    final JLabel label21 = new JLabel();
    label21.setEnabled(true);
    label21.setText(" ");
    setupPanel.add(label21, cc.xy(1, 11));
    final JLabel label22 = new JLabel();
    label22.setText(" ");
    setupPanel.add(label22, cc.xy(1, 35));
    searchDocs = new JPanel();
    searchDocs.setLayout(new FormLayout(
            "left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:277px:noGrow,left:4dlu:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(m;400px):grow,left:4dlu:noGrow,fill:max(m;200px):grow",
            "center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,top:3dlu:noGrow,center:d:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:243px:grow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:max(d;4px):noGrow,top:3dlu:noGrow,center:38px:noGrow,top:3dlu:noGrow"));
    searchDocs.setEnabled(true);
    tabbedPane1.addTab("Search", searchDocs);
    final JLabel label23 = new JLabel();
    label23.setText("Choose Semantic Knowledge Algorithm:");
    searchDocs.add(label23, cc.xyw(3, 1, 5));
    final JLabel label24 = new JLabel();
    label24.setText("Enter Search Text or select Search Document:");
    searchDocs.add(label24, cc.xyw(3, 20, 5));
    final JLabel label25 = new JLabel();
    label25.setText("Document Search Results:");
    searchDocs.add(label25, cc.xyw(10, 1, 3));
    final JLabel label26 = new JLabel();
    label26.setText("Selection Metadata:");
    searchDocs.add(label26, cc.xyw(10, 27, 3));
    selectIndexTypeComboBox = new JComboBox();
    searchDocs.add(selectIndexTypeComboBox, cc.xyw(7, 10, 3));
    final JLabel label27 = new JLabel();
    label27.setText("Index Type:");
    searchDocs.add(label27, cc.xy(7, 8));
    final JLabel label28 = new JLabel();
    label28.setText("Termweight:");
    searchDocs.add(label28, cc.xy(7, 12));
    selectTermweightComboBox = new JComboBox();
    searchDocs.add(selectTermweightComboBox, cc.xy(7, 14));
    final JLabel label29 = new JLabel();
    label29.setText("Number of search results:");
    searchDocs.add(label29, cc.xy(7, 16));
    noOfSearchResultsText = new JTextField();
    noOfSearchResultsText.setText("20");
    searchDocs.add(noOfSearchResultsText, cc.xy(7, 18, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JScrollPane scrollPane1 = new JScrollPane();
    searchDocs.add(scrollPane1, cc.xywh(7, 22, 1, 2, CellConstraints.FILL, CellConstraints.FILL));
    searchTextArea = new JTextArea();
    searchTextArea.setLineWrap(true);
    searchTextArea.setText("");
    searchTextArea.setWrapStyleWord(true);
    scrollPane1.setViewportView(searchTextArea);
    selTextRadioButton = new JRadioButton();
    selTextRadioButton.setSelected(true);
    selTextRadioButton.setText("");
    searchDocs.add(selTextRadioButton, cc.xy(5, 22));
    algTextField = new JLabel();
    algTextField.setText("Knowledge Corpus: null");
    searchDocs.add(algTextField, cc.xy(7, 3, CellConstraints.DEFAULT, CellConstraints.FILL));
    selectDocumentButton = new JButton();
    selectDocumentButton.setEnabled(false);
    selectDocumentButton.setText("Select Document");
    searchDocs.add(selectDocumentButton, cc.xy(7, 25));
    selDocRadioButton = new JRadioButton();
    selDocRadioButton.setText("");
    searchDocs.add(selDocRadioButton, cc.xy(5, 25));
    final JLabel label30 = new JLabel();
    label30.setText("Select Corpus to Search:");
    searchDocs.add(label30, cc.xyw(3, 30, 5));
    searchTopCorpRadioButton = new JRadioButton();
    searchTopCorpRadioButton.setSelected(true);
    searchTopCorpRadioButton.setText("Topic Corpus");
    searchDocs.add(searchTopCorpRadioButton, cc.xy(7, 32, CellConstraints.DEFAULT, CellConstraints.TOP));
    searchSearchCorpRadioButton = new JRadioButton();
    searchSearchCorpRadioButton.setSelected(false);
    searchSearchCorpRadioButton.setText("Search Corpus");
    searchDocs.add(searchSearchCorpRadioButton, cc.xy(7, 34, CellConstraints.DEFAULT, CellConstraints.TOP));
    searchButton = new JButton();
    searchButton.setText("Search");
    searchDocs.add(searchButton, cc.xy(7, 36));
    final JScrollPane scrollPane2 = new JScrollPane();
    searchDocs.add(scrollPane2, cc.xywh(10, 30, 3, 7, CellConstraints.FILL, CellConstraints.FILL));
    metadataTextField = new JTextArea();
    metadataTextField.setEditable(false);
    scrollPane2.setViewportView(metadataTextField);
    termTablePane = new JScrollPane();
    termTablePane.setEnabled(true);
    termTablePane.setVerticalScrollBarPolicy(22);
    searchDocs.add(termTablePane, cc.xywh(14, 3, 1, 21, CellConstraints.FILL, CellConstraints.FILL));
    termSearchResTable.setAutoCreateRowSorter(true);
    termSearchResTable.setAutoResizeMode(2);
    termSearchResTable.setFillsViewportHeight(false);
    termSearchResTable.setForeground(new Color(-16777216));
    termTablePane.setViewportView(termSearchResTable);
    docTablePane = new JScrollPane();
    docTablePane.setVerticalScrollBarPolicy(22);
    searchDocs.add(docTablePane, cc.xywh(10, 3, 3, 21, CellConstraints.FILL, CellConstraints.FILL));
    docSearchResTable.setAutoCreateRowSorter(true);
    docTablePane.setViewportView(docSearchResTable);
    final JLabel label31 = new JLabel();
    label31.setText("Term Search Result:");
    searchDocs.add(label31, cc.xy(14, 1));
    searchDocValue = new JLabel();
    searchDocValue.setText("nothing selected");
    searchDocs.add(searchDocValue, cc.xyw(12, 25, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
    openSearchDocumentButton = new JButton();
    openSearchDocumentButton.setEnabled(false);
    openSearchDocumentButton.setText("Open Search Document");
    searchDocs.add(openSearchDocumentButton, cc.xy(10, 25, CellConstraints.LEFT, CellConstraints.DEFAULT));
}

From source file:in.gov.uidai.auth.sampleapp.SampleClientMainFrame.java

private void resetBfdRankAndResults() {
    Map<FingerPosition, JLabel> fingerPosToLabelMap = getBFDPositionLabelMap();
    for (JLabel jl : fingerPosToLabelMap.values()) {
        jl.setText(" ");
    }/*from w  w w .  ja  va2s . com*/

    jLabelBFDStatusXML.setText(" ");
    jLabelBFDStatusProto.setText(" ");
}

From source file:de.tor.tribes.ui.windows.TribeTribeAttackFrame.java

/**
 * Show result frame for calculated attacks
 *//*from w w  w.j  a  va2s.  co  m*/
private void showResults(List<Attack> pAttacks) {
    mLogFrame.setVisible(false);
    jResultsTable.invalidate();
    DefaultTableModel resultModel = new javax.swing.table.DefaultTableModel(new Object[][] {},
            new String[] { "Herkunft", "Einheit", "Ziel", "Start", "Ankunft", "Typ", "" }) {

        Class[] types = new Class[] { Village.class, UnitHolder.class, Village.class, Date.class, Date.class,
                Integer.class, Boolean.class };

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

        @Override
        public boolean isCellEditable(int row, int col) {
            return false;
        }
    };

    //renderer, which marks send times red if attack is impossible to send
    DefaultTableRenderer renderer = new DefaultTableRenderer() {

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int column) {
            Component c = new DateCellRenderer().getTableCellRendererComponent(table, value, isSelected,
                    hasFocus, row, column);
            JLabel l = (JLabel) c;
            Boolean impossible = (Boolean) table.getModel().getValueAt(row, 6);
            if (impossible.booleanValue()) {
                l.setText("<html><nobr><font color='#FF0000'>" + l.getText() + "</font></nobr></html>");
            }
            return c;
        }
    };

    jResultsTable.setDefaultRenderer(Date.class, renderer);
    jResultsTable.setDefaultRenderer(Integer.class,
            new NoteIconCellRenderer(NoteIconCellRenderer.ICON_TYPE.NOTE));
    jResultsTable.setDefaultEditor(Integer.class, new NoteIconCellEditor(NoteIconCellEditor.ICON_TYPE.NOTE));
    jResultsTable.setDefaultRenderer(UnitHolder.class, new UnitCellRenderer());
    jResultsTable.setDefaultEditor(UnitHolder.class, new UnitCellEditor());
    jResultsTable.setDefaultRenderer(Village.class, new VillageCellRenderer());
    jResultsTable.setRowHeight(24);
    List<Long> startTimes = new LinkedList<Long>();
    int impossibleAttacks = 0;

    for (Attack a : pAttacks) {
        long targetTime = a.getArriveTime().getTime();
        long startTime = targetTime - (long) (DSCalculator.calculateMoveTimeInSeconds(a.getSource(),
                a.getTarget(), a.getUnit().getSpeed()) * 1000);
        boolean impossible = false;
        if (!startTimes.contains(startTime)) {
            startTimes.add(startTime);
        } else {
            impossibleAttacks++;
            impossible = true;
        }
        resultModel.addRow(new Object[] { a.getSource(), a.getUnit(), a.getTarget(), new Date(startTime),
                a.getArriveTime(), a.getType(), impossible });
    }

    jResultsTable.setModel(resultModel);

    TableColumnExt columns = jResultsTable.getColumnExt(5);
    columns.setVisible(false);
    jResultsTable.getTableHeader().setDefaultRenderer(new DefaultTableHeaderRenderer());

    jResultFrame.setVisible(true);

    if (impossibleAttacks > 0) {
        String message = "";
        if (impossibleAttacks == 1) {
            message = "<html>Ein berechneter Angriff hat einen bereits verwendeten Abschickzeitpunkt.<br/>Der entsprechende Angriff ist in der Tabelle rot markiert</html>";
        } else {
            message = "<html>" + impossibleAttacks
                    + " berechnete Angriffe haben identische Abschickzeitpunkte.<br/>Die entsprechenden Angriffe sind in der Tabelle rot markiert</html>";
        }
        showInfo(message, true);
    }
}