List of usage examples for javax.swing JLabel setFont
@BeanProperty(preferred = true, visualUpdate = true, description = "The font for the component.") public void setFont(Font font)
From source file:com.aw.swing.mvp.grid.GridManager.java
private void configureGridTitleColor() { JPanel pnlGrid = ipView.getPnlGrid(gridIndex); pnlGrid.setBorder(BorderFactory.createLineBorder(new Color(131, 172, 219))); JPanel pnlTitGrid = ipView.getPnlTitGrid(gridIndex); pnlTitGrid.setBackground(new Color(131, 172, 219)); pnlTitGrid.setLayout(//from ww w . j a va 2 s . c o m new FormLayout("fill:16dlu:noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,right:pref:grow", "center:16dlu:noGrow")); JLabel lblTitGrid = ipView.getLblTitGrid(gridIndex); lblTitGrid.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); lblTitGrid.setForeground(Color.black); numRecords = new JLabel(""); numRecords.setFont(new Font(lblTitGrid.getFont().getName(), Font.BOLD, 14)); numRecords.setForeground(Color.black); numRecords.setVisible(showTotalRegistros); pnlTitGrid.remove(lblTitGrid); CellConstraints cc = new CellConstraints(); pnlTitGrid.add(lblTitGrid, cc.xy(3, 1)); pnlTitGrid.add(numRecords, cc.xy(5, 1)); }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH1Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H1_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH2Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H2_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH3Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H3_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH4Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H4_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH5Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H5_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:com.intel.stl.ui.common.view.ComponentFactory.java
public static JLabel getH6Label(String text, int style) { JLabel label = new JLabel(text); label.setFont(UIConstants.H6_FONT.deriveFont(style)); label.setForeground(UIConstants.INTEL_DARK_GRAY); return label; }
From source file:org.jfree.chart.demo.RightPanel.java
public RightPanel(int x, int y, int width, int height, String baude[], String name[]) { setBackground(new Color(176, 199, 246)); this.width = width; this.height = height; Data[0] = "8"; Data[1] = "9"; Name = name;/*from ww w .j ava2s . c om*/ Baude = baude; setLayout(new GridLayout(8, 1, 0, 0)); lblName = new JLabel("Name"); lblName.setHorizontalAlignment(SwingConstants.CENTER); lblName.setFont(new Font("Arial", 15, 16)); add(lblName); comboBox = new JComboBox(Name); comboBox.setFont(new Font("Arial", 15, 16)); add(comboBox); JLabel lblBaude = new JLabel("Baude"); lblBaude.setFont(new Font("Arial", 15, 16)); lblBaude.setHorizontalAlignment(SwingConstants.CENTER); add(lblBaude); final JComboBox comboBox_1 = new JComboBox(Baude); comboBox_1.setFont(new Font("Arial", 15, 16)); add(comboBox_1); JLabel lblDataSize = new JLabel("Data size"); lblDataSize.setHorizontalAlignment(SwingConstants.CENTER); lblDataSize.setFont(new Font("Arial", 15, 16)); add(lblDataSize); final JComboBox comboBox_2 = new JComboBox(Data); comboBox_2.setFont(new Font("Arial", 15, 16)); add(comboBox_2); JSeparator separator = new JSeparator(); add(separator); btnOpen = new JButton("Open"); btnOpen.setFont(new Font("Arial", 15, 16)); btnOpen.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (btnOpen.getText() == "Open") { btnOpen.setText("Close"); open = true; int baude = 9600, data = 8; try { baude = Integer.parseInt((String) comboBox_1.getSelectedItem()); data = Integer.parseInt((String) comboBox_2.getSelectedItem()); } catch (Exception e) { errors += "Enter correct Bauderate\n"; error_flag = true; } comport = new Comport((String) comboBox.getSelectedItem(), baude, data); comport.start(); } else { comport.flag = false; btnOpen.setText("Open"); open = false; comport.close(); // comport.stop(); System.out.println("Comport = " + comport.isAlive()); System.out.println("Comport life = " + comport.get_life()); } } }); add(btnOpen); setBounds(x + 50, y, width - 40, height - 20); err.setBounds(x + 50, y, 50, 50); //add(err); }
From source file:sanger.team16.gui.genevar.eqtl.query.SNPGeneAssocPlot.java
public SNPGeneAssocPlot(List<Tuple> tuples, double max, double min) throws ArrayIndexOutOfBoundsException { JPanel mainPanel = new JPanel(new GridLayout(0, 3)); mainPanel.setBackground(Color.white); int size = tuples.size(); for (int i = 0; i < size; i++) { Tuple tuple = tuples.get(i);//from w w w . jav a2 s . co m String populationName = tuple.populationName; // if (trait.expressionRanks != null) { // BUG FIXED 02/02/10 if (tuple.phenotypes != null && tuple.phenotypes.length != 0) { CategoryDataset dataset = this.createDataset(tuple); JFreeChart chart = createChart(populationName, dataset, max, min); chart.setBackgroundPaint(Color.white); TextTitle textTitle = new TextTitle(tuple.subtitle); textTitle.setFont(new Font("SansSerif", Font.PLAIN, 12)); //subtitle1.setPosition(RectangleEdge.BOTTOM); textTitle.setHorizontalAlignment(HorizontalAlignment.CENTER); chart.addSubtitle(textTitle); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(this.getAutoPreferredSize()); // Original Dimension(680, 420) mainPanel.add(chartPanel); } else { BaseJPane empty = new BaseJPane(2, 50, 0, 0); empty.setPreferredSize(this.getAutoPreferredSize()); BaseJPane na = new BaseJPane(); na.setLayout(new BorderLayout()); JLabel name = new JLabel(" " + populationName); name.setFont(new Font("Arial", Font.BOLD, 12)); name.setForeground(Color.gray); na.add(name, BorderLayout.PAGE_START); JLabel message = new JLabel("Not Available"); message.setForeground(Color.lightGray); na.add(message, BorderLayout.CENTER); empty.add(Box.createHorizontalGlue()); empty.add(na); empty.add(Box.createHorizontalGlue()); empty.setBaseSpringBox(); mainPanel.add(empty); } } this.add(mainPanel); }
From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java
public JLabel createJLabel(String name) { Font jlbFont = new Font(Font.SANS_SERIF, Font.BOLD, 12); JLabel jlb = new JLabel(name); jlb.setFont(jlbFont); return jlb;// w w w . ja v a 2s . c o m }