Example usage for javax.swing JLabel setFont

List of usage examples for javax.swing JLabel setFont

Introduction

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

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.")
public void setFont(Font font) 

Source Link

Document

Sets the font for this component.

Usage

From source file:com.isencia.passerelle.hmi.generic.GenericHMI.java

private JPanel createCompositePanel(final JPanel b, final JComponent c, final String name) {
    final JPanel compositeBox = new JPanel(new VerticalLayout(5));
    int r = b.getBackground().getRed() - 20;
    if (r < 1) {
        r = 0;/*from w  w  w . ja  v a 2s  . co  m*/
    }
    if (r > 254) {
        r = 255;
    }
    int g = b.getBackground().getGreen() - 20;
    if (g < 1) {
        g = 0;
    }
    if (g > 254) {
        g = 255;
    }
    int bl = b.getBackground().getBlue() - 20;
    if (bl < 1) {
        bl = 0;
    }
    if (bl > 254) {
        bl = 255;
    }

    compositeBox.setBackground(new Color(r, g, bl));
    final JPanel title = new JPanel(new BorderLayout());
    title.setBackground(new Color(r, g, bl));
    /*
     * ImageIcon icon = new ImageIcon( Toolkit .getDefaultToolkit()
     * .getImage( (getClass()
     * .getResource("/com/isencia/passerelle/hmi/resources/composite.gif"
     * )))); JLabel lab = new JLabel(icon);
     * 
     * title.add(lab, BorderLayout.LINE_START);
     */
    final JLabel lab2 = new JLabel(name);
    final Font f = lab2.getFont();
    lab2.setFont(new Font(f.getName(), f.getStyle(), f.getSize() + 6));
    lab2.setForeground(new Color(49, 106, 196));
    title.add(lab2);
    compositeBox.add(title);
    final Border loweredbevel = BorderFactory.createLoweredBevelBorder();
    final TitledBorder border = BorderFactory.createTitledBorder(loweredbevel);

    compositeBox.setBorder(border);
    compositeBox.setName(name);
    c.setBackground(new Color(r, g, bl));
    compositeBox.add(c);
    return compositeBox;
}

From source file:diet.gridr.g5k.gui.ClusterInfoPanel.java

/**
 * This method initializes jPanel1//w w  w  . ja  v a2s  . c  o m
 *
 * @return javax.swing.JPanel
 */
private JPanel getJPanel1() {
    if (jPanel1 == null) {
        jPanel1 = new JPanel();
        jPanel1.setLayout(new BoxLayout(jPanel1, BoxLayout.X_AXIS));
        jPanel1.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        JPanel intermediaryPanel = new JPanel();
        intermediaryPanel.setLayout(new BoxLayout(intermediaryPanel, BoxLayout.Y_AXIS));
        nodesTable = new JTable();
        nodesModel = new ClusterNodesSummaryModel();
        nodesTable.setModel(nodesModel);
        JLabel nodesTableTitle = new JLabel("Nodes status");
        nodesTableTitle.setAlignmentX(JLabel.CENTER_ALIGNMENT);
        nodesTableTitle.setFont(new Font("Dialog", Font.BOLD, 14));
        intermediaryPanel.add(Box.createVerticalStrut(5));
        intermediaryPanel.add(nodesTableTitle);
        intermediaryPanel.add(Box.createVerticalStrut(10));
        intermediaryPanel.add(nodesTable.getTableHeader());
        intermediaryPanel.add(nodesTable);
        intermediaryPanel.add(Box.createVerticalStrut(10));
        intermediaryPanel.add(new JSeparator(JSeparator.HORIZONTAL));
        jPanel1.add(Box.createHorizontalGlue());
        jPanel1.add(intermediaryPanel);
        jPanel1.add(Box.createHorizontalGlue());
        LoggingManager.log(Level.FINER, LoggingManager.RESOURCESTOOL, this.getClass().getName(), "getJPanel1",
                "Cluster nodes summary table added");
    }
    return jPanel1;
}

From source file:edu.ku.brc.specify.config.init.DatabasePanel.java

/**
 * Creates a dialog for entering database name and selecting the appropriate driver.
 */// w w w  .  j a va  2  s.c  o m
@SuppressWarnings("unchecked")
public DatabasePanel(final JButton nextBtn, final JButton prevBtn, final String helpContext,
        final boolean doSetDefaultValues) {
    super("DATABASE", helpContext, nextBtn, prevBtn);

    this.doSetDefaultValues = doSetDefaultValues;

    int t = 0;
    //      for (int p : SKIP_DB_CREATE_PERMS) {
    //         t |= p;
    //      }
    //      PERM_SKIP_DB_CREATE = t;
    //      
    //      t = 0;
    for (int p : CREATE_DB_PERMS) {
        t |= p;
    }
    PERM_CREATE_DB = t;
    PERM_SKIP_DB_CREATE = t; //see comments in createSkipDBCreatePerms()

    createSkipDBCreatePerms();
    createCreateDBPerms();

    String header = getResourceString("ENTER_DB_INFO") + ":";

    CellConstraints cc = new CellConstraints();

    String rowDef = "p,2px," + UIHelper.createDuplicateJGoodiesDef("p", "2px", 7)
            + ",10px,p,10px,p,4px,p,4px,p";
    PanelBuilder builder = new PanelBuilder(new FormLayout("p,2px,p:g", rowDef), this);
    int row = 1;

    builder.add(createLabel(header, SwingConstants.CENTER), cc.xywh(1, row, 3, 1));
    row += 2;

    usernameTxt = createField(builder, "IT_USERNAME", true, row);
    row += 2;
    passwordTxt = createField(builder, "IT_PASSWORD", true, row, true, null);
    row += 2;
    dbNameTxt = createField(builder, "DB_NAME", true, row);
    row += 2;
    hostNameTxt = createField(builder, "HOST_NAME", true, row);
    row += 2;

    driverList = DatabaseDriverInfo.getDriversList();
    drivers = (JComboBox<DatabaseDriverInfo>) createComboBox(driverList);

    // MySQL as the default
    drivers.setSelectedItem(DatabaseDriverInfo.getDriver("MySQL"));

    JLabel lbl = createI18NFormLabel("DRIVER", SwingConstants.RIGHT);
    lbl.setFont(bold);
    builder.add(lbl, cc.xy(1, row));
    builder.add(drivers, cc.xy(3, row));
    row += 2;

    builder.add(createLabel(" "), cc.xy(1, row)); // spacer
    row += 2;

    isStructureOnly = createCheckBox(builder, "CONVUPLD_CHKBX", row);
    isStructureOnly.setToolTipText(getResourceString("CONVUPLD_CHKBX_TT"));
    isStructureOnly.setVisible(!UIRegistry.isMobile() && !UIRegistry.isEmbedded());
    row += 2;

    label = UIHelper.createLabel("", SwingConstants.CENTER);
    createDBBtn = UIHelper.createI18NButton("CREATE_DB");

    PanelBuilder tstPB = new PanelBuilder(new FormLayout("f:p:g,p,f:p:g", "p"));
    tstPB.add(createDBBtn, cc.xy(2, 1));

    PanelBuilder panelPB = new PanelBuilder(new FormLayout("f:p:g", "20px,p,2px,p,8px,p"));
    panelPB.add(tstPB.getPanel(), cc.xy(1, 2));
    panelPB.add(getProgressBar(), cc.xy(1, 4));
    panelPB.add(label, cc.xy(1, 6));

    builder.add(panelPB.getPanel(), cc.xy(3, row));
    row += 2;

    // Advance part of pane
    advLabel = UIHelper.createI18NLabel("ADV_DB_DESC", SwingConstants.CENTER);
    skipStepBtn = UIHelper.createI18NButton("ADV_DB_TEST");
    JComponent sep = builder.addSeparator(UIRegistry.getResourceString("ADV_TITLE"), cc.xyw(3, row, 1));
    row += 2;
    builder.add(advLabel, cc.xyw(3, row, 1));
    row += 2;

    tstPB = new PanelBuilder(new FormLayout("f:p:g,p,f:p:g", "p"));
    tstPB.add(skipStepBtn, cc.xy(2, 1));
    builder.add(tstPB.getPanel(), cc.xyw(3, row, 1));
    row += 2;

    skipStepBtn.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            createDBBtn.setEnabled(false);
            skipStepBtn.setEnabled(false);
            boolean ok = skipDBCreate();
            createDBBtn.setEnabled(true);
            skipStepBtn.setEnabled(true);
            advLabel.setText(UIRegistry.getResourceString(ok ? "ADV_DB_OK" : "ADV_DB_ERR"));
        }
    });

    createDBBtn.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            createDB();
        }
    });

    if (UIRegistry.isMobile()) {
        skipStepBtn.setVisible(false);
        advLabel.setVisible(false);
        sep.setVisible(false);
    }

    progressBar.setVisible(false);

    DocumentAdaptor docAdp = new DocumentAdaptor() {
        @Override
        protected void changed(DocumentEvent e) {
            updateBtnUI();
        }
    };
    usernameTxt.getDocument().addDocumentListener(docAdp);
    passwordTxt.getDocument().addDocumentListener(docAdp);
    dbNameTxt.getDocument().addDocumentListener(docAdp);
    hostNameTxt.getDocument().addDocumentListener(docAdp);

    updateBtnUI();
}

From source file:DialogDemo.java

/** Creates the panel shown by the second tab. */
private JPanel createFeatureDialogBox() {
    final int numButtons = 5;
    JRadioButton[] radioButtons = new JRadioButton[numButtons];
    final ButtonGroup group = new ButtonGroup();

    JButton showItButton = null;/*from  w  w  w . j a v a 2 s.c o  m*/

    final String pickOneCommand = "pickone";
    final String textEnteredCommand = "textfield";
    final String nonAutoCommand = "nonautooption";
    final String customOptionCommand = "customoption";
    final String nonModalCommand = "nonmodal";

    radioButtons[0] = new JRadioButton("Pick one of several choices");
    radioButtons[0].setActionCommand(pickOneCommand);

    radioButtons[1] = new JRadioButton("Enter some text");
    radioButtons[1].setActionCommand(textEnteredCommand);

    radioButtons[2] = new JRadioButton("Non-auto-closing dialog");
    radioButtons[2].setActionCommand(nonAutoCommand);

    radioButtons[3] = new JRadioButton("Input-validating dialog " + "(with custom message area)");
    radioButtons[3].setActionCommand(customOptionCommand);

    radioButtons[4] = new JRadioButton("Non-modal dialog");
    radioButtons[4].setActionCommand(nonModalCommand);

    for (int i = 0; i < numButtons; i++) {
        group.add(radioButtons[i]);
    }
    radioButtons[0].setSelected(true);

    showItButton = new JButton("Show it!");
    showItButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String command = group.getSelection().getActionCommand();

            // pick one of many
            if (command == pickOneCommand) {
                Object[] possibilities = { "ham", "spam", "yam" };
                String s = (String) JOptionPane.showInputDialog(frame,
                        "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog",
                        JOptionPane.PLAIN_MESSAGE, icon, possibilities, "ham");

                // If a string was returned, say so.
                if ((s != null) && (s.length() > 0)) {
                    setLabel("Green eggs and... " + s + "!");
                    return;
                }

                // If you're here, the return value was null/empty.
                setLabel("Come on, finish the sentence!");

                // text input
            } else if (command == textEnteredCommand) {
                String s = (String) JOptionPane.showInputDialog(frame,
                        "Complete the sentence:\n" + "\"Green eggs and...\"", "Customized Dialog",
                        JOptionPane.PLAIN_MESSAGE, icon, null, "ham");

                // If a string was returned, say so.
                if ((s != null) && (s.length() > 0)) {
                    setLabel("Green eggs and... " + s + "!");
                    return;
                }

                // If you're here, the return value was null/empty.
                setLabel("Come on, finish the sentence!");

                // non-auto-closing dialog
            } else if (command == nonAutoCommand) {
                final JOptionPane optionPane = new JOptionPane(
                        "The only way to close this dialog is by\n" + "pressing one of the following buttons.\n"
                                + "Do you understand?",
                        JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_NO_OPTION);

                // You can't use pane.createDialog() because that
                // method sets up the JDialog with a property change
                // listener that automatically closes the window
                // when a button is clicked.
                final JDialog dialog = new JDialog(frame, "Click a button", true);
                dialog.setContentPane(optionPane);
                dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
                dialog.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent we) {
                        setLabel("Thwarted user attempt to close window.");
                    }
                });
                optionPane.addPropertyChangeListener(new PropertyChangeListener() {
                    public void propertyChange(PropertyChangeEvent e) {
                        String prop = e.getPropertyName();

                        if (dialog.isVisible() && (e.getSource() == optionPane)
                                && (JOptionPane.VALUE_PROPERTY.equals(prop))) {
                            // If you were going to check something
                            // before closing the window, you'd do
                            // it here.
                            dialog.setVisible(false);
                        }
                    }
                });
                dialog.pack();
                dialog.setLocationRelativeTo(frame);
                dialog.setVisible(true);

                int value = ((Integer) optionPane.getValue()).intValue();
                if (value == JOptionPane.YES_OPTION) {
                    setLabel("Good.");
                } else if (value == JOptionPane.NO_OPTION) {
                    setLabel("Try using the window decorations " + "to close the non-auto-closing dialog. "
                            + "You can't!");
                } else {
                    setLabel("Window unavoidably closed (ESC?).");
                }

                // non-auto-closing dialog with custom message area
                // NOTE: if you don't intend to check the input,
                // then just use showInputDialog instead.
            } else if (command == customOptionCommand) {
                customDialog.setLocationRelativeTo(frame);
                customDialog.setVisible(true);

                String s = customDialog.getValidatedText();
                if (s != null) {
                    // The text is valid.
                    setLabel("Congratulations!  " + "You entered \"" + s + "\".");
                }

                // non-modal dialog
            } else if (command == nonModalCommand) {
                // Create the dialog.
                final JDialog dialog = new JDialog(frame, "A Non-Modal Dialog");

                // Add contents to it. It must have a close button,
                // since some L&Fs (notably Java/Metal) don't provide one
                // in the window decorations for dialogs.
                JLabel label = new JLabel("<html><p align=center>" + "This is a non-modal dialog.<br>"
                        + "You can have one or more of these up<br>" + "and still use the main window.");
                label.setHorizontalAlignment(JLabel.CENTER);
                Font font = label.getFont();
                label.setFont(label.getFont().deriveFont(font.PLAIN, 14.0f));

                JButton closeButton = new JButton("Close");
                closeButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        dialog.setVisible(false);
                        dialog.dispose();
                    }
                });
                JPanel closePanel = new JPanel();
                closePanel.setLayout(new BoxLayout(closePanel, BoxLayout.LINE_AXIS));
                closePanel.add(Box.createHorizontalGlue());
                closePanel.add(closeButton);
                closePanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 5));

                JPanel contentPane = new JPanel(new BorderLayout());
                contentPane.add(label, BorderLayout.CENTER);
                contentPane.add(closePanel, BorderLayout.PAGE_END);
                contentPane.setOpaque(true);
                dialog.setContentPane(contentPane);

                // Show it.
                dialog.setSize(new Dimension(300, 150));
                dialog.setLocationRelativeTo(frame);
                dialog.setVisible(true);
            }
        }
    });

    return createPane(moreDialogDesc + ":", radioButtons, showItButton);
}

From source file:org.forester.archaeopteryx.ControlPanel.java

static JLabel customizeLabel(final JLabel label, final Configuration configuration) {
    label.setFont(ControlPanel.jcb_bold_font);
    if (!configuration.isUseNativeUI()) {
        label.setForeground(ControlPanel.jcb_text_color);
        label.setBackground(ControlPanel.background_color);
    }/*from   www .ja  v a2 s .  c o  m*/
    return label;
}

From source file:UI.SecurityDashboard.java

private void performMetric8(MainViewPanel mvp) {
    Metric8 metric8 = new Metric8();

    JPanel graphPanel8 = new JPanel();
    graphPanel8.setLayout(new BorderLayout());
    graphPanel8.add(metric8.run(), BorderLayout.NORTH);

    AccountPanel.setLayout(new BorderLayout());
    JTextArea header = new JTextArea(
            "\nVulnerable user accounts can be exploited due to weak policies. This scan will visit all user "
                    + "accounts on each device to list user privilidges and administrator rights, as well as look for default or weak passwords "
                    + "that \ncan leave the account susceptible to brute-force attacks.\n");
    //header.setLineWrap(true);
    //header.setWrapStyleWord(true);
    header.setEditable(false);//from w  w w.ja  v  a  2s . c o  m
    AccountPanel.add(header, BorderLayout.NORTH);
    AccountPanel.add(graphPanel8, BorderLayout.CENTER);

    ChartPanel eighthPanel = mvp.getPanel8(metric8);

    eighthPanel.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent cme) {
            dashboardTabs.setSelectedIndex(8);
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent cme) {
        }
    });
    Metric8Panel.setLayout(new BorderLayout());
    Metric8Panel.setBackground(Color.white);
    Font titleFont = new Font("Calibri", Font.BOLD, 27);
    JLabel portTitleLabel = new JLabel("           User Account");
    portTitleLabel.setFont(titleFont);
    Metric8Panel.add(portTitleLabel, BorderLayout.NORTH);
    Metric8Panel.add(eighthPanel, BorderLayout.CENTER);
}

From source file:UI.SecurityDashboard.java

private void performMetric3(MainViewPanel mvp) {
    Metric3 metric3 = new Metric3();

    JPanel graphPanel3 = new JPanel();
    graphPanel3.setLayout(new BorderLayout());
    graphPanel3.add(metric3.run(), BorderLayout.NORTH);

    AntiVirusPanel.setLayout(new BorderLayout());
    JTextArea header = new JTextArea(
            "\nThis page lists all devices on the network, divided into two tables. The top table shows the "
                    + "critical issues where the devices listed are either not running an anti-virus solution or the solution is not updated. It "
                    + "will also list those anti-virus solutions which have services which are not running (Scanning is disabled). The bottom "
                    + "table shows the updated table where the devices listed have updated and running anti-virus solutions.\n");
    header.setLineWrap(true);/*from   w  w  w  .jav  a2 s . co m*/
    header.setWrapStyleWord(true);
    header.setEditable(false);
    AntiVirusPanel.add(header, BorderLayout.NORTH);
    AntiVirusPanel.add(graphPanel3, BorderLayout.CENTER);

    ChartPanel thirdPanel = mvp.getPanel3(metric3);

    thirdPanel.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent cme) {
            dashboardTabs.setSelectedIndex(3);
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent cme) {
        }
    });

    Metric3Panel.setLayout(new BorderLayout());
    Font titleFont = new Font("Calibri", Font.BOLD, 27);
    JLabel avTitleLabel = new JLabel("           AV Scan Check");
    avTitleLabel.setFont(titleFont);
    Metric3Panel.add(avTitleLabel, BorderLayout.NORTH);
    Metric3Panel.add(thirdPanel, BorderLayout.CENTER);
    Metric3Panel.setBackground(Color.white);
}

From source file:greenfoot.gui.export.ExportPublishPane.java

/**
 * Creates a login panel with a username and password and a create account option
 * @return Login panel Component/*w ww. j a va2s  .c om*/
 */
private JComponent getLoginPanel() {
    JComponent loginPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 8, 4));

    loginPanel.setBackground(background);
    loginPanel.setAlignmentX(LEFT_ALIGNMENT);
    Border border = BorderFactory.createCompoundBorder(BorderFactory.createLoweredBevelBorder(),
            BorderFactory.createEmptyBorder(12, 12, 12, 12));
    loginPanel.setBorder(border);

    JLabel text = new JLabel(Config.getString("export.publish.login"));
    text.setForeground(headingColor);
    text.setVerticalAlignment(SwingConstants.TOP);
    loginPanel.add(text);

    text = new JLabel(Config.getString("export.publish.username"), SwingConstants.TRAILING);
    text.setFont(font);
    loginPanel.add(text);
    userNameField = new JTextField(10);
    userNameField.setInputVerifier(new InputVerifier() {
        @Override
        public boolean verify(JComponent input) {
            String text = userNameField.getText();
            return text.length() > 0;
        }
    });
    userNameField.addFocusListener(new FocusAdapter() {
        @Override
        public void focusLost(FocusEvent e) {
            checkForExistingScenario();
        }
    });
    loginPanel.add(userNameField);
    text = new JLabel(Config.getString("export.publish.password"), SwingConstants.TRAILING);
    text.setFont(font);
    loginPanel.add(text);
    passwordField = new JPasswordField(10);
    loginPanel.add(passwordField);

    JLabel createAccountLabel = new JLabel(Config.getString("export.publish.createAccount"));
    {
        createAccountLabel.setBackground(background);

        createAccountLabel.setHorizontalAlignment(SwingConstants.RIGHT);
        GreenfootUtil.makeLink(createAccountLabel, createAccountUrl);
    }
    loginPanel.add(createAccountLabel);
    return loginPanel;
}

From source file:UI.SecurityDashboard.java

private void performMetric2(MainViewPanel mvp) {
    Metric2 metric2 = new Metric2();

    JPanel graphPanel2 = new JPanel();
    graphPanel2.setLayout(new BorderLayout());
    graphPanel2.add(metric2.run(), BorderLayout.NORTH);

    PatchPanel.setLayout(new BorderLayout());
    JTextArea header = new JTextArea(
            "\nThe Unpatched Software tab focuses on identifying all software on each device that is missing "
                    + "updates, or devices that are running software which is no longer supported.\n");
    //header.setLineWrap(true);
    //header.setWrapStyleWord(true);
    header.setEditable(false);/*from  ww  w.j  a  va 2 s . c om*/
    PatchPanel.add(header, BorderLayout.NORTH);
    PatchPanel.add(graphPanel2, BorderLayout.CENTER);

    ChartPanel secondPanel = mvp.getPanel2(metric2);

    secondPanel.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent cme) {
            dashboardTabs.setSelectedIndex(2);
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent cme) {
        }
    });
    Metric2Panel.setLayout(new BorderLayout());
    Font titleFont = new Font("Calibri", Font.BOLD, 27);
    JLabel patchTitleLabel = new JLabel("        Unpatched Software");
    patchTitleLabel.setFont(titleFont);
    Metric2Panel.add(patchTitleLabel, BorderLayout.NORTH);
    Metric2Panel.add(secondPanel, BorderLayout.CENTER);
    Metric2Panel.setBackground(Color.white);
}

From source file:UI.SecurityDashboard.java

private void performMetric6(MainViewPanel mvp) {
    Metric6 metric6 = new Metric6();

    JPanel graphPanel6 = new JPanel();
    graphPanel6.setLayout(new BorderLayout());
    graphPanel6.add(metric6.run(), BorderLayout.NORTH);

    DefencePanel.setLayout(new BorderLayout());
    JTextArea header = new JTextArea(
            "\nThe network defence panel is designated to analysing network devices such as Firewalls, Routers, "
                    + "and Switches, and helps to ensure that the boundary defence is the work is well maintained. These devices must be updated "
                    + "correctly configured in order to prevent unauthorised external access.\n");
    header.setLineWrap(true);/*from   w ww . ja v a 2s  .c  o m*/
    header.setWrapStyleWord(true);
    header.setEditable(false);
    DefencePanel.add(header, BorderLayout.NORTH);
    DefencePanel.add(graphPanel6, BorderLayout.CENTER);

    ChartPanel sixthPanel = mvp.getPanel6(metric6);

    sixthPanel.addChartMouseListener(new ChartMouseListener() {

        @Override
        public void chartMouseClicked(ChartMouseEvent cme) {
            dashboardTabs.setSelectedIndex(6);
        }

        @Override
        public void chartMouseMoved(ChartMouseEvent cme) {
        }
    });

    Metric6Panel.setLayout(new BorderLayout());
    Font titleFont = new Font("Calibri", Font.BOLD, 27);
    JLabel netDefTitleLabel = new JLabel("           Network Defence");
    netDefTitleLabel.setFont(titleFont);
    Metric6Panel.add(netDefTitleLabel, BorderLayout.NORTH);
    Metric6Panel.add(sixthPanel, BorderLayout.CENTER);
    Metric6Panel.setBackground(Color.white);
}