Example usage for javax.swing BorderFactory createRaisedBevelBorder

List of usage examples for javax.swing BorderFactory createRaisedBevelBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createRaisedBevelBorder.

Prototype

public static Border createRaisedBevelBorder() 

Source Link

Document

Creates a border with a raised beveled edge, using brighter shades of the component's current background color for highlighting, and darker shading for shadows.

Usage

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

public ChartPanel getChart(String title) {
    ChartPanel chartpanel = new ChartPanel(chart);
    chartpanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(title),
            BorderFactory.createRaisedBevelBorder()));
    return chartpanel;
}

From source file:at.ac.tuwien.ibk.biqini.pep.gui.PEPGUI.java

public PEPGUI(String arg0, Vector<IBandwidthTracer> qosRules) {
    super(arg0);//from ww w .  j ava 2  s  .c  o m

    // initiate all collections
    tsc = new TimeSeriesCollection[MAXCHARTS];
    charts = new JFreeChart[MAXCHARTS];
    positions = new Vector<Integer>();
    chartPosition = new Hashtable<String, Integer>();
    for (int i = 0; i < MAXCHARTS; i++)
        positions.add(i);
    allSessions = new Hashtable<String, IBandwidthTracer>();

    // fill the BandwidthGenerator with the ongoing QoSRules
    bandwidthGenerator = new BandwidthGenerator();
    Enumeration<IBandwidthTracer> enbandwidth = qosRules.elements();
    while (enbandwidth.hasMoreElements()) {
        IBandwidthTracer b = enbandwidth.nextElement();
        allSessions.put(b.getName(), b);
        bandwidthGenerator.add(b);
    }

    gridBagLayout = new GridBagLayout();

    //insert the list with all QoS rules
    GridBagConstraints c = new GridBagConstraints();
    c.weighty = 9;
    c.weightx = 2.0;
    c.gridheight = MAXCHARTS;
    c.fill = GridBagConstraints.BOTH;
    content = new JPanel(gridBagLayout);
    qoSRuleList = new JList(allSessions.keySet().toArray());
    qoSRuleList.setPreferredSize(new java.awt.Dimension(200, 600));
    qoSRuleList.setBorder(BorderFactory.createRaisedBevelBorder());

    // set a MouseListner on the List
    MouseListener mouseListener = new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {

            if (e.getButton() == MouseEvent.BUTTON1) {
                int index = qoSRuleList.locationToIndex(e.getPoint());
                addStream(allSessions.get(allSessions.keySet().toArray()[index]));
            }
            if (e.getButton() == MouseEvent.BUTTON3) {
                int index = qoSRuleList.locationToIndex(e.getPoint());
                removeStream(allSessions.get(allSessions.keySet().toArray()[index]));
            }
        }
    };
    qoSRuleList.addMouseListener(mouseListener);

    // place all parts at the content pane
    gridBagLayout.setConstraints(qoSRuleList, c);
    content.add(qoSRuleList);
    setContentPane(content);
    content.setSize(1000, 800);

    //create all GUI aspects for our Charts
    insertAllCharts();

    //Start the thread that fills up our time series
    periodicBandwidthReader = new Thread(bandwidthGenerator);
    periodicBandwidthReader.setName("data-collector");
    periodicBandwidthReader.start();
}

From source file:org.lmn.fc.frameworks.starbase.plugins.observatory.ui.tabs.fft.impl.AveragingFFTCanvas.java

/***********************************************************************************************
 * Initialise this UIComponent./*w  w  w .ja  v  a  2  s  . c o  m*/
 */

public void initialiseUI() {
    final Border compoundBorder;

    super.initialiseUI();
    removeAll();

    setBackground(getBackgroundColour().getColor());
    setOpaque(true);

    // Make sure that the Canvas uses all available space...
    setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));

    // Add a Border to the Canvas panel
    compoundBorder = BorderFactory.createCompoundBorder(BorderFactory.createRaisedBevelBorder(),
            BorderFactory.createLoweredBevelBorder());
    setBorder(compoundBorder);

    // There is only ever one Chart, a special version with no Toolbar
    setChartViewer(new LogLinChartUIComponent(getHostFrameUI().getHostTask(), getHostInstrument(), "FFT", null,
            REGISTRY.getFrameworkResourceKey(), DataUpdateType.PRESERVE,
            REGISTRY.getIntegerProperty(
                    getHostInstrument().getHostAtom().getResourceKey() + KEY_DISPLAY_DATA_MAX),
            -1000.0, 1000.0, -1000.0, 1000.0) {
        final static long serialVersionUID = -2433194350569140263L;

        /**********************************************************************************
         * Customise the XYPlot of a new chart, e.g. for fixed range axes.
         *
         * @param datasettype
         * @param primarydataset
         * @param secondarydatasets
         * @param updatetype
         * @param displaylimit
         * @param channelselector
         * @param debug
         *
         * @return JFreeChart
         */

        public JFreeChart createCustomisedChart(final DatasetType datasettype, final XYDataset primarydataset,
                final List<XYDataset> secondarydatasets, final DataUpdateType updatetype,
                final int displaylimit, final ChannelSelectorUIComponentInterface channelselector,
                final boolean debug) {
            final JFreeChart jFreeChart;

            jFreeChart = super.createCustomisedChart(datasettype, primarydataset, secondarydatasets, updatetype,
                    displaylimit, channelselector, debug);
            // Remove all labels
            jFreeChart.setTitle(EMPTY_STRING);

            if ((jFreeChart.getXYPlot() != null) && (jFreeChart.getXYPlot().getDomainAxis() != null)) {
                jFreeChart.getXYPlot().getDomainAxis().setLabel(EMPTY_STRING);
            }

            if ((jFreeChart.getXYPlot() != null) && (jFreeChart.getXYPlot().getRangeAxis() != null)) {
                jFreeChart.getXYPlot().getRangeAxis().setLabel(EMPTY_STRING);
            }

            return (jFreeChart);
        }

        /**********************************************************************************
         * Initialise the Chart.
         */

        public synchronized void initialiseUI() {
            final String SOURCE = "ChartUIComponent.initialiseUI() ";

            setChannelSelector(false);
            setDatasetDomainControl(false);

            super.initialiseUI();

            // Indicate if the Chart can Autorange, and is currently Autoranging
            setCanAutorange(true);
            setLinearMode(true);

            // Configure the Chart for this specific use
            if (getChannelSelectorOccupant() != null) {
                getChannelSelectorOccupant().setAutoranging(true);
                getChannelSelectorOccupant().setLinearMode(true);
                getChannelSelectorOccupant().setDecimating(false);
                getChannelSelectorOccupant().setLegend(false);
                getChannelSelectorOccupant().setShowChannels(false);
                getChannelSelectorOccupant().debugSelector(LOADER_PROPERTIES.isChartDebug(), SOURCE);
            }
        }
    });

    getChartViewer().initialiseUI();

    add((Component) getChartViewer(), BorderLayout.CENTER);
}

From source file:eu.europeana.sip.gui.SipCreatorGUI.java

public SipCreatorGUI() throws FileStoreException {
    super("Delving SIP Creator");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    MetadataModel metadataModel = loadMetadataModel();
    File fileStoreDirectory = getFileStoreDirectory();
    FileStore fileStore = new FileStoreImpl(fileStoreDirectory, metadataModel);
    GroovyCodeResource groovyCodeResource = new GroovyCodeResource();
    this.dataSetListModel = new DataSetListModel(new DataSetListModel.ConnectedStatus() {
        @Override/*from   w ww.  j a v a  2s. c  o  m*/
        public boolean isConnected() {
            return connectedBox.isSelected();
        }
    });
    this.dataSetList = new JList(dataSetListModel);
    this.sipModel = new SipModel(fileStore, metadataModel, groovyCodeResource, new PopupExceptionHandler());
    this.dataSetClient = new DataSetClient(new DataSetClient.Context() {

        @Override
        public String getServerUrl() {
            return sipModel.getAppConfigModel().getServerUrl();
        }

        @Override
        public String getAccessKey() {
            return sipModel.getAppConfigModel().getAccessKey();
        }

        @Override
        public void setInfo(DataSetInfo dataSetInfo) {
            dataSetListModel.setDataSetInfo(dataSetInfo);
            dataSetActions.setDataSetInfo(dataSetInfo);
        }

        @Override
        public void setList(List<DataSetInfo> list) {
            if (list != null) {
                Set<String> untouched = dataSetListModel.setDataSetInfoList(list);
                if (!untouched.isEmpty()) {
                    dataSetActions.setUntouched(untouched);
                }
                for (DataSetInfo dataSetInfo : list) {
                    dataSetActions.setDataSetInfo(dataSetInfo);
                }
            } else {
                log.warn("received empty list from the server");
            }
        }

        @Override
        public void tellUser(String message) {
            sipModel.getUserNotifier().tellUser(message);
        }

        @Override
        public void disconnected() {
            connectedBox.setSelected(false);
            sipModel.getUserNotifier().tellUser(String.format("Disconnected from Repository at %s",
                    sipModel.getAppConfigModel().getServerHostPort()));
        }
    });
    dataSetActions = new DataSetActions(this, sipModel, dataSetClient, new Runnable() {
        @Override
        public void run() {
            dataSetListModel.clear();
            for (FileStore.DataSetStore dataSetStore : sipModel.getFileStore().getDataSetStores().values()) {
                dataSetListModel.setDataSetStore(dataSetStore);
            }
            dataSetListModel.setPattern(filter.getText());
        }
    });
    setJMenuBar(createMenuBar());
    JPanel main = new JPanel(new BorderLayout(MARGIN, MARGIN));
    main.setBorder(BorderFactory.createEmptyBorder(MARGIN, MARGIN, MARGIN, MARGIN));
    JPanel north = new JPanel(new BorderLayout());
    north.setBorder(
            BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(MARGIN, MARGIN, 0, MARGIN),
                    BorderFactory.createRaisedBevelBorder()));
    titleLabel.setOpaque(true);
    titleLabel.setFont(new Font("Sans", Font.BOLD, 24));
    JLabel northRight = new JLabel(new ImageIcon(getClass().getResource("/delving-logo.png")));
    north.add(createFilterPanel(), BorderLayout.WEST);
    north.add(titleLabel, BorderLayout.CENTER);
    north.add(northRight, BorderLayout.EAST);
    getContentPane().add(north, BorderLayout.NORTH);
    getContentPane().add(main, BorderLayout.CENTER);
    JPanel south = new JPanel(new GridLayout(1, 0));
    south.add(createConnectPanel());
    south.add(createFinishedPanel());
    getContentPane().add(south, BorderLayout.SOUTH);
    main.add(createList(), BorderLayout.CENTER);
    main.add(dataSetActions.getPanel(), BorderLayout.EAST);
    setSize(SIZE);
    setLocation((Toolkit.getDefaultToolkit().getScreenSize().width - SIZE.width) / 2,
            (Toolkit.getDefaultToolkit().getScreenSize().height - SIZE.height) / 2);
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            for (FileStore.DataSetStore dataSetStore : sipModel.getFileStore().getDataSetStores().values()) {
                dataSetListModel.setDataSetStore(dataSetStore);
            }
        }
    });
}

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

ControlPanel(final MainPanel ap, final Configuration config_settings) {
    init();//from  w ww  . j a v  a  2 s  .  co m
    _mainpanel = ap;
    _configuration = config_settings;
    setDefaultColors();
    if (!_configuration.isUseNativeUI()) {
        setBackground(ControlPanel.background_color);
        setBorder(BorderFactory.createRaisedBevelBorder());
    }
    setLayout(new GridLayout(0, 1, 2, 2));
    _order_of_appearance = true;
    setupControls();
    //Dimension dim =new Dimension();
    //dim.height =200;
    //dim.width =200;
    //setPreferredSize( dim);
}

From source file:com.att.aro.ui.view.menu.tools.RegexWizard.java

private JTextArea createTextAreaAndProperties(String title) {
    JTextArea textArea = new JTextArea();
    textArea.setLineWrap(true);/*from  w w  w  . java 2s  .c  o m*/
    TitledBorder ttlBorder = BorderFactory.createTitledBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder()), title);
    ttlBorder.setTitleColor(Color.BLUE);
    ttlBorder.setTitleFont(ttlBorder.getTitleFont().deriveFont(Font.BOLD));
    textArea.setBorder(ttlBorder);
    textArea.addFocusListener(this);
    return textArea;
}

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);/* www .  ja v  a2  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:edu.ucla.stat.SOCR.applications.demo.BinomialTradingApplication.java

public DefaultGraphCell createVertex(String name, double x, double y, double w, double h, Color bg,
        boolean raised) {

    // Create vertex with the given name
    DefaultGraphCell cell = new DefaultGraphCell(name);
    /*   ob.x = x; /*from   w w w . j a va  2  s . c om*/
       ob.y = y;*/
    //   System.out.println("adding node:"+ob.toString()+" to cell "+cellCount +"at ("+x+","+y+")");
    // Set bounds
    GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(x, y, w, h));

    // Set fill color
    if (bg != null) {
        GraphConstants.setGradientColor(cell.getAttributes(), bg);
        GraphConstants.setOpaque(cell.getAttributes(), true);
    }

    // Set raised border
    if (raised)
        GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createRaisedBevelBorder());
    else
        // Set black border
        GraphConstants.setBorderColor(cell.getAttributes(), Color.black);

    // Add a Floating Port
    cell.addPort();

    return cell;
}

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   ww  w  . j  a  v  a  2  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.diversityarrays.kdxplore.curate.SampleEntryPanel.java

private JPanel generateStatControls() {

    JPanel statsPanel = new JPanel();
    GBH gbh = new GBH(statsPanel);

    int x = 0;/*ww w  .  jav  a  2  s.  co  m*/

    for (StatType statType : StatType.values()) {
        JButton button = new JButton(statType.label);
        button.addActionListener(statButtonActionListener);

        statButtonByStatType.put(statType, button);

        JComponent valueLabel = null;
        if (statType == StatType.MODE) {
            JComboBox<String> combo = new JComboBox<String>();
            combo.addActionListener(statButtonActionListener);

            valueLabel = combo;
            valueLabel.setMaximumSize(new Dimension(100, 25));
        } else {
            JButton btn = new JButton();
            btn.addActionListener(statButtonActionListener);

            valueLabel = btn;
        }
        statComponentByStatType.put(statType, valueLabel);
        statTypeByButton.put(valueLabel, statType);

        Font myFont = new Font(Font.SANS_SERIF, Font.BOLD, 10);
        TitledBorder roundedTitledBorder = new TitledBorder(BorderFactory.createRaisedBevelBorder(),
                statType.name(), 1, 2, myFont);

        valueLabel.setBorder(roundedTitledBorder);

        gbh.add(x, 0, 1, 1, GBH.BOTH, 2, 3, GBH.CENTER, valueLabel);
        x++;
    }
    return statsPanel;
}