Example usage for java.awt Font BOLD

List of usage examples for java.awt Font BOLD

Introduction

In this page you can find the example usage for java.awt Font BOLD.

Prototype

int BOLD

To view the source code for java.awt Font BOLD.

Click Source Link

Document

The bold style constant.

Usage

From source file:jotp.java

public void init() {

    setBackground(Color.white);/*from  w w w. j av a 2s.  c  o  m*/
    setLayout(new GridLayout(6, 1));

    Panel panel1 = new Panel();
    add(panel1);
    Font titlefont = new Font("TimesRoman", Font.BOLD, 14);
    panel1.setFont(titlefont);
    panel1.add(new Label(String.valueOf(version) + ": The Java OTP (aka S/Key) calculator!"));
    Panel panel2 = new Panel();
    panel2.setLayout(new FlowLayout());
    add(panel2);
    panel2.add(new Label("Challenge (e.g. \"55 latour1\"):"));
    chaltf = new TextField(24);
    panel2.add(chaltf);

    Panel panel3 = new Panel();
    panel3.setLayout(new FlowLayout());
    add(panel3);
    panel3.add(new Label("Secret Password:"));
    pwtf = new TextField(24);
    pwtf.setEchoCharacter('*');
    panel3.add(pwtf);

    Panel panel4 = new Panel();
    panel4.setLayout(new FlowLayout());
    add(panel4);

    panel4.add(new Button(String.valueOf(md4label)));
    panel4.add(new Button(String.valueOf(md5label)));

    Panel panel6 = new Panel();
    panel6.setLayout(new FlowLayout());
    add(panel6);
    panel6.add(new Label("One-Time Password:", Label.LEFT));
    otptf = new TextField(40);
    panel6.add(otptf);

    Panel panel7 = new Panel();
    add(panel7);
    panel7.add(new Label("jotp by Harry Mantakos, " + "http://www.cs.umd.edu/~harry/jotp"));
}

From source file:SwingTypeTester9.java

private void initComponents() {
    parent = this;
    handler = new CharacterEventHandler();
    producer = new RandomCharacterGenerator();
    producer.setDone(true);/*from  w ww  . j  av  a  2  s .  com*/
    producer.start();
    displayCanvas = new AnimatedCharacterDisplayCanvas(producer);
    feedbackCanvas = new CharacterDisplayCanvas(this);
    quitButton = new JButton();
    startButton = new JButton();
    stopButton = new JButton();
    score = new ScoreLabel(producer, this);

    Container pane = getContentPane();
    JPanel p1 = new JPanel();
    p1.setLayout(new BoxLayout(p1, BoxLayout.PAGE_AXIS));
    p1.add(displayCanvas);
    p1.add(feedbackCanvas);

    JPanel p2 = new JPanel();
    score.setText("      ");
    score.setFont(new Font("MONOSPACED", Font.BOLD, 30));
    p2.add(score);
    startButton.setText("Start");
    p2.add(startButton);
    stopButton.setText("Stop");
    stopButton.setEnabled(false);
    p2.add(stopButton);
    quitButton.setText("Quit");
    p2.add(quitButton);
    p1.add(p2);
    pane.add(p1, BorderLayout.NORTH);
    pack();

    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent evt) {
            quit();
        }
    });
    feedbackCanvas.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent ke) {
            char c = ke.getKeyChar();
            if (c != KeyEvent.CHAR_UNDEFINED)
                newCharacter((int) c);
        }
    });
    startButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            new FeedbackFrame(parent).show();
        }
    });
    stopButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            startButton.setEnabled(true);
            stopButton.setEnabled(false);
            producer.setDone(true);
            displayCanvas.setDone(true);
            feedbackCanvas.setEnabled(false);
        }
    });
    quitButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            quit();
        }
    });
}

From source file:de.hs.mannheim.modUro.diagram.JCellcycletimeDiagram.java

protected JFreeChart createChart(XYDataset dataset, List<String> celltypes) {
    String title = "Cell cycle times";

    JFreeChart xyLineChart = ChartFactory.createXYLineChart(title, // title
            "t", // x-axis label
            "T", // y-axis label
            dataset);/*  w w w .j  a v  a 2  s.  c o m*/

    String fontName = "Palatino";
    xyLineChart.getTitle().setFont(new Font(fontName, Font.BOLD, 18));

    XYPlot plot = (XYPlot) xyLineChart.getPlot();
    plot.setDomainPannable(true);
    plot.setRangePannable(true);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.getDomainAxis().setLowerMargin(0.0);
    plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    plot.getRangeAxis().setLowerMargin(0.0);
    // plot.getRangeAxis().setRange(0.0, 1.01);
    plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    xyLineChart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14));
    xyLineChart.getLegend().setFrame(BlockBorder.NONE);
    xyLineChart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER);
    XYItemRenderer r = plot.getRenderer();

    // set the default stroke for all series
    int i = 0;
    for (String celltype : celltypes) {
        r.setSeriesPaint(i, CellTypeColor.getColor(celltype));
        i++;
    }
    return xyLineChart;
}

From source file:org.jfree.graphics2d.demo.SVGPieChartDemo1.java

/**
 * Creates a chart./* w  w  w . j a v a  2s  .  co  m*/
 *
 * @param dataset  the dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(PieDataset dataset) {

    JFreeChart chart = ChartFactory.createPieChart("Smart Phones Manufactured / Q3 2011", // chart title
            dataset);
    chart.removeLegend();

    // set a custom background for the chart
    chart.setBackgroundPainter(new GradientPainter(new Color(20, 20, 20), RectangleAnchor.TOP_LEFT,
            Color.DARK_GRAY, RectangleAnchor.BOTTOM_RIGHT));

    // customise the title position and font
    TextTitle t = chart.getTitle();
    t.setHorizontalAlignment(HorizontalAlignment.LEFT);
    t.setPaint(new Color(240, 240, 240));
    t.setFont(new Font("Arial", Font.BOLD, 26));

    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setBackgroundPainter(null);
    plot.setInteriorGap(0.04);
    plot.setBorderPainter(null);

    // use gradients and white borders for the section colours
    plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
    plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
    plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
    plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
    plot.setBaseSectionOutlinePaint(Color.WHITE);
    plot.setSectionOutlinesVisible(true);
    plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));

    // customise the section label appearance
    plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
    plot.setLabelLinkPaint(Color.WHITE);
    plot.setLabelLinkStroke(new BasicStroke(2.0f));
    plot.setLabelOutlineStroke(null);
    plot.setLabelPaint(Color.WHITE);
    plot.setLabelBackgroundPaint(null);
    // add a subtitle giving the data source
    TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
            new Font("Courier New", Font.PLAIN, 12));
    source.setPaint(Color.WHITE);
    source.setPosition(RectangleEdge.BOTTOM);
    source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
    chart.addSubtitle(source);
    return chart;

}

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

public BPVideoWarnFailPanel() {
    JPanel mainPanel = new JPanel();
    this.add(mainPanel);
    mainPanel.setLayout(new GridBagLayout());
    GridBagConstraints constraint = new GridBagConstraints();
    mainPanel.add(getGridPanel(), constraint);
    mainPanel.add(getDefaultButton("Default", (ActionEvent arg) -> setDefault()), constraint);
    compileResultsField.setEditable(false);
    if (sError.isEmpty()) {
        compileResultsField.setBackground(mainPanel.getBackground());
        compileResultsField.setForeground(Color.red);
        compileResultsField.setFont(compileResultsField.getFont().deriveFont(Font.BOLD));
        compileResultsField.setText("");
        compileResultsField.setVisible(false);
    } else {/*from  w  ww.  java  2s .  c  o m*/
        compileResultsField.setVisible(true);
        compileResultsField.setForeground(Color.red);
        compileResultsField.setText(String.format("ERRORS: %s", sError));
    }
    constraint.anchor = GridBagConstraints.FIRST_LINE_START;
    constraint.gridy = 300;
    constraint.gridwidth = 2;
    mainPanel.add(compileResultsField, constraint);
}

From source file:com.game.ui.views.MapEditor.java

public void generateGUI() throws IOException {
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    //        setResizable(false);
    JMenuBar menubar = new JMenuBar();
    ImageIcon icon = null;//from w w  w.j  a  v a 2s.c o m
    try {
        icon = GameUtils.shrinkImage("save.png", 20, 20);
    } catch (IOException e) {
        System.out.println("Dialog : showDialogForMap(): Exception occured :" + e);
        e.printStackTrace();
    }
    JMenu file = new JMenu("File");
    JMenuItem save = new JMenuItem("Save", icon);
    save.setToolTipText("Save Map Information");
    save.setActionCommand("Save Map");
    save.addActionListener(this);
    file.add(save);
    menubar.add(file);
    setJMenuBar(menubar);
    JPanel topPanel = new JPanel();
    topPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    topPanel.setLayout(new GridBagLayout());
    JLabel headerLbl = new JLabel("Legend : ");
    headerLbl.setFont(new Font("Times New Roman", Font.BOLD, 15));
    JLabel lbl1 = new JLabel();
    lbl1.setPreferredSize(new Dimension(50, 20));
    lbl1.setBackground(Configuration.pathColor);
    lbl1.setOpaque(true);
    JLabel lbl2 = new JLabel("- Represents the path.");
    JLabel lbl3 = new JLabel();
    lbl3.setPreferredSize(new Dimension(50, 20));
    lbl3.setBackground(Configuration.enemyColor);
    lbl3.setOpaque(true);
    JLabel lbl4 = new JLabel("- Represents the path with monsters");
    JLabel lbl5 = new JLabel();
    lbl5.setPreferredSize(new Dimension(50, 20));
    lbl5.setBackground(Configuration.startPointColor);
    lbl5.setOpaque(true);
    JLabel lbl6 = new JLabel("- Represents the starting point in the path");
    JLabel lbl7 = new JLabel();
    lbl7.setBackground(Configuration.endPointColor);
    lbl7.setOpaque(true);
    lbl7.setPreferredSize(new Dimension(50, 20));
    JLabel lbl8 = new JLabel("- Ending point in the path");
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridx = 0;
    c.weightx = 1;
    c.weighty = 0;
    c.insets = new Insets(5, 5, 5, 5);
    c.gridwidth = 2;
    topPanel.add(headerLbl, c);
    c.fill = GridBagConstraints.NONE;
    c.gridx = 0;
    c.gridy = 1;
    c.weightx = 0;
    c.weighty = 0;
    c.gridwidth = 1;
    c.ipadx = 5;
    c.ipady = 5;
    topPanel.add(lbl1, c);
    c.gridx = 1;
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    topPanel.add(lbl2, c);
    c.gridx = 0;
    c.gridy = 2;
    topPanel.add(lbl3, c);
    c.gridx = 1;
    topPanel.add(lbl4, c);
    c.gridx = 0;
    c.gridy = 3;
    topPanel.add(lbl5, c);
    c.gridx = 1;
    topPanel.add(lbl6, c);
    c.gridx = 0;
    c.gridy = 4;
    topPanel.add(lbl7, c);
    c.gridx = 1;
    topPanel.add(lbl8, c);
    add(topPanel, BorderLayout.NORTH);
    bottomPanel = new JPanel();
    add(bottomPanel, BorderLayout.CENTER);
    bottomPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    //        bottomPanel.add(new JButton("kaushik"));
    pack();
    setExtendedState(JFrame.MAXIMIZED_BOTH);
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    setMaximizedBounds(env.getMaximumWindowBounds());
    setVisible(true);
    callDialogForUsersInput();
}

From source file:edu.ucla.stat.SOCR.analyses.gui.KolmogorovSmirnoff.java

/**Initialize the Analysis*/
public void init() {
    showSelect = false;/*from w  ww  . j  a v a2  s .  c  om*/
    showVisualize = false;
    showInput = false;
    super.init();
    analysisType = AnalysisType.KOLMOGOROV_SMIRNOFF;
    useInputExample = false;
    useLocalExample = false;
    useRandomExample = true;
    useServerExample = false;
    useStaticExample = KolmogorovSmirnoffExamples.availableExamples;
    depMax = 1; // max number of dependent var
    indMax = 1; // max number of independent var
    resultPanelTextArea.setFont(new Font(outputFontFace, Font.BOLD, outputFontSize));
    frame = getFrame(this);
    setName("Regression & Correlation Analysis");
    // Create the toolBar
    toolBar = new JToolBar();
    createActionComponents(toolBar);
    this.getContentPane().add(toolBar, BorderLayout.NORTH);
    depLabel.setText(VARIABLE_1);
    indLabel.setText(VARIABLE_2);
    validate();
    reset();
}

From source file:motordrivertxrx.View.MainView.java

/**
 * Creates new form MainView//from   ww  w .  ja  va 2s . c o  m
 */
public MainView() {
    initComponents();

    this.dataset1 = new DefaultValueDataset(10.0);
    this.dataset2 = new DefaultValueDataset(50.0);

    // get data for diagrams
    DialPlot plot = new DialPlot();
    plot.setView(0.0, 0.0, 1.0, 1.0);
    plot.setDataset(0, this.dataset1);
    plot.setDataset(1, this.dataset2);
    SimpleDialFrame dialFrame = new SimpleDialFrame();
    dialFrame.setBackgroundPaint(Color.lightGray);
    dialFrame.setForegroundPaint(Color.DARK_GRAY);
    plot.setDialFrame(dialFrame);
    /*
    GradientPaint gp = new GradientPaint(new Point(), 
        new Color(255, 255, 255), new Point(), 
        new Color(170, 170, 220));
    */
    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), Color.ORANGE);

    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    plot.setBackground(db);

    DialTextAnnotation annotation1 = new DialTextAnnotation("Velocidad");
    annotation1.setFont(new Font("Dialog", Font.BOLD, 14));
    annotation1.setRadius(0.7);

    plot.addLayer(annotation1);

    DialValueIndicator dvi = new DialValueIndicator(0, "c");
    dvi.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi.setOutlinePaint(Color.darkGray);
    dvi.setRadius(0.60);
    dvi.setAngle(-103.0);
    plot.addLayer(dvi);

    DialValueIndicator dvi2 = new DialValueIndicator(1, "c");
    dvi2.setFont(new Font("Dialog", Font.PLAIN, 10));
    dvi2.setOutlinePaint(Color.red);
    dvi2.setRadius(0.60);
    dvi2.setAngle(-77.0);
    plot.addLayer(dvi2);

    StandardDialScale scale = new StandardDialScale(0, 127, -120, -300);
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 14));
    plot.addScale(0, scale);

    StandardDialScale scale2 = new StandardDialScale(0, 100, -120, -300);
    scale2.setTickRadius(0.50);
    scale2.setTickLabelOffset(0.15);
    scale2.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10));
    scale2.setMajorTickPaint(Color.red);
    plot.addScale(1, scale2);
    plot.mapDatasetToScale(1, 1);

    DialPointer needle2 = new DialPointer.Pin(1);
    needle2.setRadius(0.55);
    plot.addLayer(needle2);

    DialPointer needle = new DialPointer.Pointer(0);
    plot.addLayer(needle);

    DialCap cap = new DialCap();
    cap.setRadius(0.10);
    plot.setCap(cap);

    JFreeChart chart1 = new JFreeChart(plot);
    chart1.setTitle("Velocidad motor");
    ChartPanel cp1 = new ChartPanel(chart1);
    cp1.setPreferredSize(new Dimension(400, 400));

    /*JPanel sliderPanel = new JPanel(new GridLayout(2, 2));
    sliderPanel.add(new JLabel("Outer Needle:"));
    sliderPanel.add(new JLabel("Inner Needle:"));
    this.slider1 = new JSlider(-40, 60);
    this.slider1.setMajorTickSpacing(20);
    this.slider1.setPaintTicks(true);
    this.slider1.setPaintLabels(true);
    this.slider1.addChangeListener(this);
    sliderPanel.add(this.slider1);
    sliderPanel.add(this.slider1);
    this.slider2 = new JSlider(0, 100);
    this.slider2.setMajorTickSpacing(20);
    this.slider2.setPaintTicks(true);
    this.slider2.setPaintLabels(true);
    this.slider2.addChangeListener(this);
    sliderPanel.add(this.slider2);*/

    velocimetroPanel.add(cp1);

}

From source file:com.compomics.pepshell.view.statistics.JFreeChartPanel.java

private static void setupPlot(XYPlot xYPlot) {
    // set background to white and grid color to black
    xYPlot.setBackgroundPaint(Color.white);
    xYPlot.setRangeGridlinePaint(Color.black);
    // hide the border of the sorrounding box
    xYPlot.setOutlinePaint(Color.white);
    // get domanin and range axes
    ValueAxis domainAxis = xYPlot.getDomainAxis();
    ValueAxis rangeAxis = xYPlot.getRangeAxis();
    // set label paint for axes to black
    domainAxis.setLabelPaint(Color.black);
    rangeAxis.setLabelPaint(Color.black);
    // set font for labels, both on domain and range axes
    domainAxis.setLabelFont(new Font("Tahoma", Font.BOLD, 12));
    rangeAxis.setLabelFont(new Font("Tahoma", Font.BOLD, 12));
}

From source file:org.broad.igv.peaks.PeakTrackMenu.java

private void init(final TrackClickEvent trackClickEvent) {

    Collection<Track> tracks = IGV.getInstance().getSelectedTracks(); //Arrays.asList(new Track[] {track});

    //Title/*from w  w w.  jav  a2s  .  c  om*/
    JLabel popupTitle = new JLabel("<html><b>" + track.getName(), JLabel.LEFT);
    Font newFont = getFont().deriveFont(Font.BOLD, 12);
    popupTitle.setFont(newFont);
    add(popupTitle);
    addSeparator();

    add(TrackMenuUtils.getTrackRenameItem(tracks));
    add(TrackMenuUtils.getChangeTrackHeightItem(tracks));
    add(TrackMenuUtils.getChangeFontSizeItem(tracks));

    //Change Track Settings
    addDisplayModeItems();

    addSeparator();
    JMenuItem plotItem = new JMenuItem("Open Trend Plot...");
    plotItem.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            openTimeSeriesPlot(trackClickEvent);
        }
    });
    add(plotItem);

    if (track.isShowSignals()) {
        add(TrackMenuUtils.getDataRangeItem(tracks));
        add(TrackMenuUtils.getLogScaleItem(tracks));
        add(TrackMenuUtils.getShowDataRangeItem(tracks));
    }

    addSeparator();
    add(TrackMenuUtils.getRemoveMenuItem(tracks));
}