Example usage for javax.swing JTabbedPane setFont

List of usage examples for javax.swing JTabbedPane setFont

Introduction

In this page you can find the example usage for javax.swing JTabbedPane 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:org.jfree.chart.demo.LeftPanel.java

public LeftPanel(ArrayList<ChartPanel> graphics, ArrayList<Graphic> Grafs, ArrayList<JFreeChart> charts,
        ArrayList<XYSeries> Series) {
    //setBackground(new Color(152 ,134, 202));
    //setBackground(new Color(234 ,247, 202));
    setSize(800, 530);//ww  w  .  j a v  a2 s .  c o  m
    setLayout(null);
    setBackground(new Color(176, 199, 246));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    tabbedPane.setBackground(new Color(174, 250, 127));

    tabbedPane.setFont(new Font("Arial", 15, 16));
    tabbedPane.setOpaque(false);

    tabbedPane.setBounds(7, 6, 750, 505);
    tabbedPane.setAlignmentY(Component.TOP_ALIGNMENT);
    add(tabbedPane);

    JPanel panel = new JPanel();
    panel.setBackground(new Color(176, 199, 246));
    panel.setToolTipText("Graphic 1");
    panel.add(graphics.get(0));
    panel.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(0), 0));
    tabbedPane.addTab("Graphic 1", null, panel, null);
    panel.setLayout(null);

    JPanel panel_2 = new JPanel();
    panel_2.add(graphics.get(1));
    tabbedPane.addTab("Graphic 2", null, panel_2, null);
    panel_2.setLayout(null);
    panel_2.setBackground(new Color(176, 199, 246));
    panel_2.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(1), 1));

    JPanel panel_1 = new JPanel();
    panel_1.add(graphics.get(2));
    tabbedPane.addTab("Graphic 3", null, panel_1, null);
    panel_1.setLayout(null);
    panel_1.setBackground(new Color(176, 199, 246));
    panel_1.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(2), 2));
    panel_1.setBackground(new Color(176, 199, 246));

    JPanel panel_3 = new JPanel();
    panel_3.add(graphics.get(3));
    tabbedPane.addTab("Graphic 4", null, panel_3, null);
    panel_3.setLayout(null);
    panel_3.setBackground(new Color(176, 199, 246));
    panel_3.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(3), 3));

    JPanel panel_4 = new JPanel();
    panel_4.add(graphics.get(4));
    tabbedPane.addTab("Graphic 5 ", null, panel_4, null);
    panel_4.setLayout(null);
    panel_4.setBackground(new Color(176, 199, 246));
    panel_4.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(4), 4));

    JPanel panel_5 = new JPanel();
    panel_5.add(graphics.get(5));
    tabbedPane.addTab("Graphic 6", null, panel_5, null);
    panel_5.setLayout(null);
    panel_5.setBackground(new Color(176, 199, 246));
    panel_5.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(5), 5));

    JPanel panel_6 = new JPanel();
    panel_6.add(graphics.get(6));
    tabbedPane.addTab("Graphic 7", null, panel_6, null);
    panel_6.setLayout(null);
    panel_6.setBackground(new Color(176, 199, 246));
    panel_6.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(6), 6));

    JPanel panel_7 = new JPanel();
    panel_7.add(graphics.get(7));
    tabbedPane.addTab("Graphic 8", null, panel_7, null);
    panel_7.setLayout(null);
    panel_7.setBackground(new Color(176, 199, 246));
    panel_7.add(new bottom_slider(new Color(176, 199, 246), charts, Grafs.get(7), 7));

    JPanel panel_8 = new JPanel();
    panel_8.add(new Bottom_panel(Grafs, Series, 5, 390, 735, 50));
    graphics.set(8, Grafs.get(8).get_ChartPanel(740, 390));
    panel_8.add(graphics.get(8));

    tabbedPane.addTab("Graphic 9", null, panel_8, null);
    panel_8.setLayout(null);
    panel_8.setBackground(new Color(176, 199, 246));

    JPanel panel_9 = new JPanel();
    panel_9.add(graphics.get(9));
    tabbedPane.addTab("Graphic 10", null, panel_9, null);
    panel_9.setLayout(null);
    panel_9.setBackground(new Color(176, 199, 246));

}

From source file:com.polivoto.vistas.Charts.java

private void crearPieChart(Pregunta pregunta) {
    JTabbedPane tabPanel = new JTabbedPane();
    panelGrafica.add(tabPanel);/*from w ww .j a v a 2 s.co m*/

    //Calcular el nmero N de perfiles. Si N=1, no discriminar por pestanas. 
    //Si son N perfiles (N>2), hacer N+1 pestanas (la ltima representa la
    //suma de los resultados sin segregacin.
    int n = pregunta.obtenerCantidadDePerfiles();
    System.out.println(" n " + n);
    if (n > 1) {
        for (int i = 0; i < n; i++) {
            JPanel panel = hacerPiePanel(pregunta, pregunta.obtenerResultadoPorPerfil(i).getOpciones());
            panel.setName(pregunta.obtenerResultadoPorPerfil(i).getPerfil());
            tabPanel.addTab(panel.getName(), panel);

        }
    }

    JPanel panel = hacerPiePanel(pregunta, pregunta.obtenerOpciones());
    panel.setName("Todos");
    tabPanel.addTab(panel.getName(), panel);
    tabPanel.setFont(new Font("Roboto", 0, 24));
    tabPanel.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            tabIndex = ((JTabbedPane) (e.getSource())).getSelectedIndex();
        }
    });
    tabPanel.setSelectedIndex(tabIndex);
    panelGrafica.add(tabPanel, BorderLayout.CENTER);
    panelGrafica.repaint();
    panelGrafica.revalidate();
}