Example usage for javax.swing.table JTableHeader setForeground

List of usage examples for javax.swing.table JTableHeader setForeground

Introduction

In this page you can find the example usage for javax.swing.table JTableHeader setForeground.

Prototype

@BeanProperty(preferred = true, visualUpdate = true, description = "The foreground color of the component.")
public void setForeground(Color fg) 

Source Link

Document

Sets the foreground color of this component.

Usage

From source file:Main.java

public static void main(String[] args) {
    Integer[][] data = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
    String[] cols = { "A", "B", "C" };

    JTable table = new JTable(data, cols);

    JTableHeader header = table.getTableHeader();
    header.setBackground(Color.black);
    header.setForeground(Color.yellow);

    JOptionPane.showMessageDialog(null, new JScrollPane(table));
}

From source file:nl.phanos.liteliveresultsclient.gui.ResultsWindows.java

private void initCustumComponents() {
    logoLabel = new javax.swing.JLabel();
    icon = new ImageIcon(getCLub());
    logoLabel.setIcon(icon); // NOI18N
    logoLabel.setBounds(this.getWidth() - icon.getIconWidth(), this.getHeight() - icon.getIconHeight(),
            icon.getIconWidth(), icon.getIconHeight());
    LayerdPane.add(logoLabel, JLayeredPane.PALETTE_LAYER);
    clockLabel = new javax.swing.JLabel();
    clockLabel.setFont(new java.awt.Font("Lucida Grande", 0, fontSize)); // NOI18N
    clockLabel.setText("");
    clockLabel.setForeground(Color.YELLOW);
    LayerdPane.add(clockLabel, JLayeredPane.PALETTE_LAYER);
    jTable1.setRowSelectionAllowed(false);
    jTable1.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {},
            new String[] { "Plaats", "Atleet", "Tijd" }) {
        Class[] types = new Class[] { java.lang.Integer.class, java.lang.String.class, java.lang.String.class };
        boolean[] canEdit = new boolean[] { false, false, false };

        public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
        }/*from   w  w w.j  a v a 2 s .c o  m*/

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
        }
    });

    jScrollPane1.getViewport().setBackground(Color.black);
    this.setBackground(Color.black);
    JTableHeader header = jTable1.getTableHeader();
    header.setOpaque(false);
    jPanel1.setBackground(Color.black);
    header.setBackground(Color.black);
    header.setForeground(Color.YELLOW);
    DefaultTableCellRenderer headerRenderer = new DefaultTableCellRenderer();
    headerRenderer.setBackground(Color.BLACK);

    for (int i = 0; i < jTable1.getModel().getColumnCount(); i++) {
        if (jTable1.getModel().getColumnCount() > 0) {
            jTable1.getColumnModel().getColumn(i).setHeaderRenderer(headerRenderer);
        }
    }
    DefaultTableCellRenderer LEFTRenderer = new DefaultTableCellRenderer();
    LEFTRenderer.setHorizontalAlignment(JLabel.LEFT);
    jTable1.getColumnModel().getColumn(0).setCellRenderer(LEFTRenderer);
    ChangeFont(fontSize);
}

From source file:com.xilinx.kintex7.MainScreen.java

private JPanel testAndStats() {
    JPanel tstats = new JPanel();
    tstats.setLayout(new BoxLayout(tstats, BoxLayout.Y_AXIS));

    JPanel ledPanel = new JPanel(new BorderLayout());

    JPanel iledPanel = new JPanel();
    iledPanel.setLayout(new BoxLayout(iledPanel, BoxLayout.X_AXIS));

    led_ddr3 = new JLabel("DDR3", new ImageIcon(led1), JLabel.CENTER);
    led_phy0 = new JLabel("10G PHY-0", new ImageIcon(led1), JLabel.CENTER);
    led_phy1 = new JLabel("10G PHY-1", new ImageIcon(led1), JLabel.CENTER);

    JPanel le1 = new JPanel(new BorderLayout());
    le1.add(led_ddr3, BorderLayout.CENTER);

    JPanel le2 = new JPanel(new BorderLayout());
    le2.add(led_phy0, BorderLayout.CENTER);

    JPanel le3 = new JPanel(new BorderLayout());
    le3.add(led_phy1, BorderLayout.CENTER);

    iledPanel.add(le1);//from ww w . j av  a  2  s.  c o  m
    iledPanel.add(le2);
    iledPanel.add(le3);

    ledPanel.add(iledPanel, BorderLayout.CENTER);
    tstats.add(ledPanel);

    JPanel tstats1 = new JPanel();
    tstats1.setLayout(new BoxLayout(tstats1, BoxLayout.Y_AXIS));

    tstats1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    tstats1.add(testPanelItems());

    JPanel dmaInner = new JPanel(new BorderLayout());

    JPanel dmaPanel = new JPanel(new BorderLayout());

    dmaPanel.setBackground(new Color(130, 170, 180));
    table1 = new MyTableModel(dummy_data, dmaColumnNames0);
    dmaStats1 = new JTable(table1);
    try {
        dmaStats1.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader = dmaStats1.getTableHeader();
    dmaHeader.setForeground(new Color(92, 25, 25));

    dmaPanel.add(dmaHeader, BorderLayout.PAGE_START);
    dmaPanel.add(dmaStats1, BorderLayout.CENTER);
    dmaInner.add(dmaPanel, BorderLayout.CENTER);
    tstats1.add(dmaInner);
    tstats.add(tstats1);

    JPanel trnPanel = new JPanel(new GridLayout(1, 1));
    trnPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("PCIe Statistics"),
            BorderFactory.createRaisedBevelBorder()));
    JPanel trn1 = new JPanel(new FlowLayout());
    trn1.add(new JLabel("Transmit (writes in Gbps): "));
    trnLTX = new JTextField("0.0", 5);
    trnLTX.setEditable(false);
    trn1.add(trnLTX);
    trn1.add(new JLabel("Receive (reads in Gbps): "));
    trnLRX = new JTextField("0.0", 5);
    trnLRX.setEditable(false);
    trn1.add(trnLRX);
    trnPanel.add(trn1);
    tstats.add(trnPanel);

    JPanel tstats2 = new JPanel();
    tstats2.setLayout(new BoxLayout(tstats2, BoxLayout.Y_AXIS));
    tstats2.add(testPanelItems1());

    tstats2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    JPanel dmaPanel1 = new JPanel(new BorderLayout());

    table2 = new MyTableModel(dummy_data, dmaColumnNames1);
    dmaStats2 = new JTable(table2);
    try {
        dmaStats2.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader1 = dmaStats2.getTableHeader();
    dmaHeader1.setForeground(new Color(92, 25, 25));

    dmaPanel1.add(dmaHeader1, BorderLayout.PAGE_START);
    dmaPanel1.add(dmaStats2, BorderLayout.CENTER);
    tstats2.add(dmaPanel1);
    tstats.add(tstats2);

    JPanel tstats3 = new JPanel(new BorderLayout());
    tstats3.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Message Log"),
            BorderFactory.createRaisedBevelBorder()));
    textArea = new CustomTextPane();

    final JScrollPane scrollPane = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    // keep scrollbar at end showing latest messages
    scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {
        BoundedRangeModel brm = scrollPane.getVerticalScrollBar().getModel();
        boolean wasAtBottom = true;

        @Override
        public void adjustmentValueChanged(AdjustmentEvent ae) {
            if (!brm.getValueIsAdjusting()) {
                if (wasAtBottom)
                    brm.setValue(brm.getMaximum());
            } else
                wasAtBottom = ((brm.getValue() + brm.getExtent()) == brm.getMaximum());
        }
    });

    textArea.setEditable(false);
    tstats3.add(scrollPane, BorderLayout.CENTER);
    tstats.add(tstats3);
    return tstats;
}

From source file:com.xilinx.kintex7.MainScreen.java

private JPanel pciInfo() {
    JPanel pciSystemPanel = new JPanel();
    pciSystemPanel.setLayout(new BoxLayout(pciSystemPanel, BoxLayout.Y_AXIS));

    JPanel topPanel = new JPanel(new GridLayout(1, 2));
    topPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("PCIe Settings"),
            BorderFactory.createRaisedBevelBorder()));
    JPanel sPanel = new JPanel(new FlowLayout());
    sPanel.add(new JLabel("Link Speed: "));
    Object[] speeds = { "2.5 Gbps", "5.0 Gbps" };
    final PartialDisableComboBox lspeed = new PartialDisableComboBox();
    lspeed.addItems(speeds);/*from  w  w w. j  a v a2  s . c  om*/

    lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed - 1);
    lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed - 1, false);

    sPanel.add(lspeed);
    JButton setSpeed = new JButton("Go");
    setSpeed.setToolTipText("This enables directed PCIe link speed change");
    setSpeed.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent ae) {
            if (lspeed.isItemEnabled(lspeed.getSelectedIndex())) {
                int ret = di.setLinkSpeed(lspeed.getSelectedIndex() + 1);
                if (ret == 0) {
                    //update pcie information
                    di.get_PCIstate();
                    lspeed.setItemEnabled(0, true);
                    lspeed.setItemEnabled(1, true);
                    lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed - 1);
                    lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed - 1, false);
                    ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames);
                    ptable.fireTableDataChanged();
                } else {
                    updateLog("Unable to set Link Speed " + lspeed.getSelectedItem(), keyWord);
                }
            }
        }
    });

    sPanel.add(setSpeed);
    topPanel.add(sPanel);

    JPanel sPanel1 = new JPanel(new FlowLayout());
    sPanel1.add(new JLabel("Link Width: "));
    Object[] widths = { "x1", "x2", "x4", "x8" };
    final PartialDisableComboBox lwidths = new PartialDisableComboBox();
    lwidths.addItems(widths);
    lwidths.setSelectedItem("x" + di.getPCIInfo().LinkWidth);
    lwidths.setItemEnabled(lwidths.getSelectedIndex(), false);
    sPanel1.add(lwidths);
    JButton setWidth = new JButton("Go");
    setWidth.setToolTipText("This enables directed PCIe link width change");
    setWidth.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent ae) {
            if (lwidths.isItemEnabled(lwidths.getSelectedIndex())) {
                int ret = di.setLinkWidth(lwidths.getSelectedIndex() + 1);
                if (ret == 0) {
                    //update pcie information
                    // some times width change affect link speed so
                    // enable the same in lspeedd also
                    di.get_PCIstate();
                    lwidths.setItemEnabled(0, true);
                    lwidths.setItemEnabled(1, true);
                    lwidths.setItemEnabled(2, true);
                    lwidths.setItemEnabled(3, true);
                    lwidths.setSelectedItem("x" + di.getPCIInfo().LinkWidth);
                    lwidths.setItemEnabled(lwidths.getSelectedIndex(), false);

                    // some times width change affect link speed so
                    // enable the same in lspeed also
                    lspeed.setItemEnabled(0, true);
                    lspeed.setItemEnabled(1, true);
                    lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed - 1);
                    lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed - 1, false);

                    ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames);
                    ptable.fireTableDataChanged();

                } else {
                    di.get_PCIstate();
                    int upCap = di.getPCIInfo().LinkUpCap;

                    if (upCap == 0)
                        updateLog("Unable to set Link Width " + lwidths.getSelectedItem()
                                + ". PCIe link not upconfigurable", keyWord);

                    else
                        updateLog("Unable to set Link Width " + lwidths.getSelectedItem(), keyWord);

                }
            }
        }
    });
    sPanel1.add(setWidth);
    topPanel.add(sPanel1);

    pciSystemPanel.add(topPanel);
    JPanel panel = new JPanel(new GridLayout(1, 2));

    JPanel pciPanel = new JPanel(new BorderLayout());
    pciPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("PCIe Endpoint Status"), BorderFactory.createRaisedBevelBorder()));
    ptable = new MyTableModel(di.getPCIInfo().getPCIData(), pcieColumnNames);
    pcieTable = new JTable(ptable);
    try {
        pcieTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }

    JTableHeader pcieHeader = pcieTable.getTableHeader();
    pcieHeader.setForeground(new Color(92, 25, 25));

    pciPanel.add(pcieHeader, BorderLayout.PAGE_START);
    pciPanel.add(pcieTable, BorderLayout.CENTER);

    panel.add(pciPanel);

    JPanel hostPanel = new JPanel(new BorderLayout());
    hostPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Host System's Initial Credits"),
            BorderFactory.createRaisedBevelBorder()));
    htable = new MyTableModel(di.getPCIInfo().getHostedData(), pcieColumnNames);
    hostTable = new JTable(htable);
    try {
        hostTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }

    JTableHeader hostHeader = hostTable.getTableHeader();
    hostHeader.setForeground(new Color(92, 25, 25));

    hostPanel.add(hostHeader, BorderLayout.PAGE_START);
    hostPanel.add(hostTable, BorderLayout.CENTER);

    panel.add(hostPanel);

    pciSystemPanel.add(panel);

    pciSystemPanel.add(dialChart(pciSystemPanel.getWidth()));

    return pciSystemPanel;
}

From source file:com.xilinx.virtex7.MainScreen.java

private JPanel testAndStats() {
    JPanel tstats = new JPanel();
    tstats.setLayout(new BoxLayout(tstats, BoxLayout.Y_AXIS));

    JPanel tstats1 = new JPanel();
    tstats1.setLayout(new BoxLayout(tstats1, BoxLayout.Y_AXIS));

    tstats1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    tstats1.add(testPanelItems());/*from  www.  ja v a 2s.co  m*/

    JPanel dmaInner = new JPanel(new BorderLayout());

    JPanel dmaPanel = new JPanel(new BorderLayout());

    dmaPanel.setBackground(new Color(130, 170, 180));
    table1 = new MyTableModel(dummy_data, dmaColumnNames0);
    dmaStats1 = new JTable(table1);
    try {
        dmaStats1.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader = dmaStats1.getTableHeader();
    dmaHeader.setForeground(new Color(92, 25, 25));

    dmaPanel.add(dmaHeader, BorderLayout.PAGE_START);
    dmaPanel.add(dmaStats1, BorderLayout.CENTER);
    dmaInner.add(dmaPanel, BorderLayout.CENTER);
    tstats1.add(dmaInner);
    tstats.add(tstats1);

    //tstats.add(trnPanel);

    JPanel tstats2 = new JPanel();
    tstats2.setLayout(new BoxLayout(tstats2, BoxLayout.Y_AXIS));
    tstats2.add(testPanelItems1());

    tstats2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    JPanel dmaPanel1 = new JPanel(new BorderLayout());

    table2 = new MyTableModel(dummy_data, dmaColumnNames1);
    dmaStats2 = new JTable(table2);
    try {
        dmaStats2.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader1 = dmaStats2.getTableHeader();
    dmaHeader1.setForeground(new Color(92, 25, 25));

    dmaPanel1.add(dmaHeader1, BorderLayout.PAGE_START);
    dmaPanel1.add(dmaStats2, BorderLayout.CENTER);
    tstats2.add(dmaPanel1);
    tstats.add(tstats2);

    return tstats;
}

From source file:com.xilinx.virtex7.MainScreen.java

private JPanel testAndStatsSecondTab() {
    JPanel tstats = new JPanel();
    tstats.setLayout(new BoxLayout(tstats, BoxLayout.Y_AXIS));

    JPanel tstats1 = new JPanel();
    tstats1.setLayout(new BoxLayout(tstats1, BoxLayout.Y_AXIS));

    tstats1.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    tstats1.add(testPanelItems2());// need to change testPanelItems method.

    JPanel dmaInner = new JPanel(new BorderLayout());

    JPanel dmaPanel = new JPanel(new BorderLayout());

    dmaPanel.setBackground(new Color(130, 170, 180));
    table1T2 = new MyTableModel(dummy_data, dmaColumnNames2);
    dmaStats1T2 = new JTable(table1T2);
    try {/*from  ww w  .ja  v  a 2s. c o m*/
        dmaStats1T2.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader = dmaStats1T2.getTableHeader();
    dmaHeader.setForeground(new Color(92, 25, 25));

    dmaPanel.add(dmaHeader, BorderLayout.PAGE_START);
    dmaPanel.add(dmaStats1T2, BorderLayout.CENTER);
    dmaInner.add(dmaPanel, BorderLayout.CENTER);
    tstats1.add(dmaInner);
    tstats.add(tstats1);

    /*JPanel trnPanel = new JPanel(new GridLayout(1,1));
    trnPanel.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createTitledBorder("PCIe Statistics"),
                BorderFactory.createRaisedBevelBorder()));
    JPanel trn1 = new JPanel(new FlowLayout());
    trn1.add(new JLabel("Transmit (writes in Gbps): "));
    trnLTXT2 = new JTextField("0.0", 5);
    trnLTXT2.setEditable(false);
    trn1.add(trnLTXT2);
    trn1.add(new JLabel("Receive (reads in Gbps): "));
    trnLRXT2 = new JTextField("0.0", 5);
    trnLRXT2.setEditable(false);
    trn1.add(trnLRXT2);
    trnPanel.add(trn1);
    tstats.add(trnPanel);*/

    JPanel tstats2 = new JPanel();
    tstats2.setLayout(new BoxLayout(tstats2, BoxLayout.Y_AXIS));
    tstats2.add(testPanelItems3());

    tstats2.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(""),
            BorderFactory.createRaisedBevelBorder()));

    JPanel dmaPanel1 = new JPanel(new BorderLayout());

    table2T2 = new MyTableModel(dummy_data, dmaColumnNames3);
    dmaStats2T2 = new JTable(table2T2);
    try {
        dmaStats2T2.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }
    JTableHeader dmaHeader1 = dmaStats2T2.getTableHeader();
    dmaHeader1.setForeground(new Color(92, 25, 25));

    dmaPanel1.add(dmaHeader1, BorderLayout.PAGE_START);
    dmaPanel1.add(dmaStats2T2, BorderLayout.CENTER);
    tstats2.add(dmaPanel1);
    tstats.add(tstats2);
    return tstats;
}

From source file:com.xilinx.virtex7.MainScreen.java

private JPanel pciInfo() {
    JPanel pciSystemPanel = new JPanel();
    pciSystemPanel.setLayout(new BoxLayout(pciSystemPanel, BoxLayout.Y_AXIS));
    //pciSystemPanel.setLayout(new GridLayout(2, 1));

    JPanel topPanel = new JPanel(new GridLayout(1, 2));
    topPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("PCIe Settings"),
            BorderFactory.createRaisedBevelBorder()));
    /*JPanel sPanel = new JPanel(new FlowLayout());
    sPanel.add(new JLabel("Link Speed: "));
    Object[] speeds = {"2.5 Gbps","5.0 Gbps"};
    final PartialDisableComboBox lspeed = new PartialDisableComboBox();
    lspeed.addItems(speeds);/*from  w ww  .j a  v a  2 s .  co m*/
            
    // hack for safe exit
    if (di.getPCIInfo().LinkSpeed != 0 && di.getPCIInfo().LinkSpeed-1 < speeds.length){
    lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1);
    lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false);
    }else{
    if (di.getPCIInfo().LinkSpeed == 4){
        System.out.println(di.getPCIInfo().LinkSpeed-2);
       // lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-2);
       // lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-2, false);
    }else
        updateLog("Invalid Link Speed", keyWord);
    }
    sPanel.add(lspeed);
    JButton setSpeed = new JButton("Go");
    setSpeed.setToolTipText("This enables directed PCIe link speed change");
    setSpeed.addActionListener(new ActionListener() {
            
    @Override
    public void actionPerformed(ActionEvent ae) {
        if (lspeed.isItemEnabled(lspeed.getSelectedIndex()))
        {
            int ret = 0;
            if (lspeed.getSelectedIndex() == 2)
               ret = di.setLinkSpeed(lspeed.getSelectedIndex()+2);
            else
               ret = di.setLinkSpeed(lspeed.getSelectedIndex()+1); 
            if (ret == 0){
                //update pcie information
                di.get_PCIstate();
                lspeed.setItemEnabled(0, true);
                lspeed.setItemEnabled(1, true);
                lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1);
                lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false);
                ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames);
                ptable.fireTableDataChanged();
            }
            else{
                updateLog("Unable to set Link Speed "+lspeed.getSelectedItem(), keyWord);
            }
        }
    }
    });
            
    sPanel.add(setSpeed);
    // topPanel.add(sPanel);
            
    JPanel sPanel1 = new JPanel(new FlowLayout());
    sPanel1.add(new JLabel("Link Width: "));
    Object[] widths = {"x1","x2","x4","x8"};
    final PartialDisableComboBox lwidths = new PartialDisableComboBox();
    lwidths.addItems(widths);
    lwidths.setSelectedItem("x"+di.getPCIInfo().LinkWidth);
    lwidths.setItemEnabled(lwidths.getSelectedIndex(), false);
    sPanel1.add(lwidths);
    JButton setWidth = new JButton("Go");
    setWidth.setToolTipText("This enables directed PCIe link width change");
    setWidth.addActionListener(new ActionListener() {
            
    @Override
    public void actionPerformed(ActionEvent ae) {
        if (lwidths.isItemEnabled(lwidths.getSelectedIndex()))
        {
            int ret = di.setLinkWidth(lwidths.getSelectedIndex()+1);
            if (ret == 0){
                //update pcie information
                // some times width change affect link speed so
                // enable the same in lspeedd also
                di.get_PCIstate();
                lwidths.setItemEnabled(0, true);
                lwidths.setItemEnabled(1, true);
                lwidths.setItemEnabled(2, true);
                lwidths.setItemEnabled(3, true);
                lwidths.setSelectedItem("x"+di.getPCIInfo().LinkWidth);
                lwidths.setItemEnabled(lwidths.getSelectedIndex(), false);
            
                // some times width change affect link speed so
                // enable the same in lspeed also
                lspeed.setItemEnabled(0, true);
                lspeed.setItemEnabled(1, true);
                lspeed.setSelectedIndex(di.getPCIInfo().LinkSpeed-1);
                lspeed.setItemEnabled(di.getPCIInfo().LinkSpeed-1, false);
            
                ptable.setData(di.getPCIInfo().getPCIData(), pcieColumnNames);
                ptable.fireTableDataChanged();
            
            }else
            {
                di.get_PCIstate();
                int upCap = di.getPCIInfo().LinkUpCap;
                                             
                if (upCap == 0)
                    updateLog("Unable to set Link Width "+lwidths.getSelectedItem()+". PCIe link not upconfigurable", keyWord);
            
                else
                    updateLog("Unable to set Link Width "+lwidths.getSelectedItem(), keyWord);
            
            }
        }
    }
    });
    sPanel1.add(setWidth);
    //  topPanel.add(sPanel1);
    */

    //  pciSystemPanel.add(topPanel);
    JPanel panel = new JPanel(new GridLayout(1, 2));

    JPanel pciPanel = new JPanel(new BorderLayout());
    pciPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("PCIe Endpoint Status"), BorderFactory.createRaisedBevelBorder()));
    ptable = new MyTableModel(di.getPCIInfo().getPCIData(), pcieColumnNames);
    pcieTable = new JTable(ptable);
    try {
        pcieTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }

    JTableHeader pcieHeader = pcieTable.getTableHeader();
    pcieHeader.setForeground(new Color(92, 25, 25));

    pciPanel.add(pcieHeader, BorderLayout.PAGE_START);
    pciPanel.add(pcieTable, BorderLayout.CENTER);

    panel.add(pciPanel);

    JPanel hostPanel = new JPanel(new BorderLayout());
    hostPanel.setBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createTitledBorder("Host System's Initial Credits"),
            BorderFactory.createRaisedBevelBorder()));
    htable = new MyTableModel(di.getPCIInfo().getHostedData(), pcieColumnNames);
    hostTable = new JTable(htable);
    try {
        hostTable.setDefaultRenderer(Object.class, new CustomTableCellRenderer());
    } catch (Exception e) {
    }

    JTableHeader hostHeader = hostTable.getTableHeader();
    hostHeader.setForeground(new Color(92, 25, 25));

    hostPanel.add(hostHeader, BorderLayout.PAGE_START);
    hostPanel.add(hostTable, BorderLayout.CENTER);

    panel.add(hostPanel);

    pciSystemPanel.add(panel);

    pciSystemPanel.add(dialChart(pciSystemPanel.getWidth()));

    return pciSystemPanel;
}