List of usage examples for javax.swing JLabel setForeground
@BeanProperty(preferred = true, visualUpdate = true, description = "The foreground color of the component.") public void setForeground(Color fg)
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: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(/* www. j ava 2s .co 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.github.cmisbox.ui.BaseFrame.java
public BaseFrame() { super(AWTUtilitiesWrapper.isTranslucencyCapable(BaseFrame.gc) ? BaseFrame.gc : null); this.log = LogFactory.getLog(this.getClass()); this.gradient = false; this.setUndecorated(true); this.mainPanel = new JPanel(new GridBagLayout()) { private static final long serialVersionUID = 1035974033526970010L; protected void paintComponent(Graphics g) { if ((g instanceof Graphics2D) && BaseFrame.this.gradient) { final int R = 0; final int G = 0; final int B = 0; Paint p = new GradientPaint(0.0f, 0.0f, new Color(R, G, B, 192), this.getWidth(), this.getHeight(), new Color(R, G, B, 255), true); Graphics2D g2d = (Graphics2D) g; g2d.setPaint(p);/*from w w w . ja v a2 s . c o m*/ g2d.fillRect(0, 0, this.getWidth(), this.getHeight()); } else { super.paintComponent(g); } } }; this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); GridBagConstraints gbc = new GridBagConstraints(); this.mainPanel.setDoubleBuffered(false); this.mainPanel.setOpaque(false); this.mainPanel.setBorder(BorderFactory.createLineBorder(Color.white)); JLabel title = new JLabel(this.getWindowTitle(), SwingConstants.CENTER); title.setForeground(Color.white); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.gridx = 1; gbc.gridy = 0; gbc.weightx = 100; this.mainPanel.add(title, gbc); Image closeImg = this.getImage("images/application-exit.png", 32, 32); JLabel close = new JLabel(new ImageIcon(closeImg), SwingConstants.RIGHT); gbc.fill = GridBagConstraints.NONE; gbc.gridx = 2; gbc.weightx = 0; this.mainPanel.add(close, gbc); close.addMouseListener(this.closeAdapter); this.getContentPane().add(this.mainPanel, BorderLayout.CENTER); this.initComponents(); this.pack(); this.mainPanel.setOpaque(!this.gradient); if (!this.gradient) { this.mainPanel.setBackground(new Color(0, 0, 0, 208)); } this.setLocationRelativeTo(null); AWTUtilitiesWrapper.setWindowOpaque(this, false); this.setVisible(true); this.setAlwaysOnTop(true); }
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);/*w ww . j a v a2s. c o 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:LayeredPaneDemo.java
private JLabel createColoredLabel(String text, Color color, Point origin) { JLabel label = new JLabel(text); label.setVerticalAlignment(JLabel.TOP); label.setHorizontalAlignment(JLabel.CENTER); label.setOpaque(true);//from www . j a va 2s . c om label.setBackground(color); label.setForeground(Color.black); label.setBorder(BorderFactory.createLineBorder(Color.black)); label.setBounds(origin.x, origin.y, 140, 140); return label; }
From source file:components.LayeredPaneDemo2.java
private JLabel createColoredLabel(String text, Color color) { JLabel label = new JLabel(text); label.setVerticalAlignment(JLabel.TOP); label.setHorizontalAlignment(JLabel.CENTER); label.setOpaque(true);//w w w . j a v a 2 s . com label.setBackground(color); label.setForeground(Color.black); label.setBorder(BorderFactory.createLineBorder(Color.black)); label.setPreferredSize(new Dimension(140, 140)); return label; }
From source file:com.eviware.soapui.support.editor.inspectors.auth.ExpirationTimeChooser.java
ExpirationTimeChooser(OAuth2Profile profile) { this.profile = profile; setLayout(new BorderLayout(0, 0)); initializeRadioButtons();/*ww w . j a v a 2s.co m*/ JPanel timeSelectionPanel = createTimeSelectionPanel(); JPanel northPanel = new JPanel(new GridLayout(3, 1, 0, 0)); northPanel.add(serverExpirationTimeOption); northPanel.add(manualExpirationTimeOption); northPanel.add(timeSelectionPanel); add(northPanel, BorderLayout.NORTH); JPanel centerPanel = new JPanel(new BorderLayout(0, 0)); JLabel label = new JLabel( "<html>Here you can set an expiry time if the OAuth 2 server doesn't,<br/>so that the token retrieval can be automated.</html>"); label.setForeground(new Color(143, 143, 143)); centerPanel.add(label, BorderLayout.NORTH); add(centerPanel, BorderLayout.CENTER); // JLabel helpLink = UISupport.createLabelLink( "http://www.soapui.org", "Learn how to use the token expiration time " ); // add( helpLink, BorderLayout.SOUTH ); }
From source file:it.ferogrammer.ui.MainAppFrame.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed jPanel2.setLayout(new BorderLayout()); NucleotideSeq seq = null;/*from w w w .ja va 2s . c o m*/ try { seq = new NucleotideSeq(jTextField1.getText(), (int) jSpinner1.getValue()); ElectropherogramChartPanel chartPanel = new ElectropherogramChartPanel(seq); // jPanel2.add(new JButton("bubububu"),BorderLayout.NORTH); jPanel2.removeAll(); jPanel2.add(chartPanel, BorderLayout.CENTER); } catch (IllegalArgumentException e) { JLabel errorLabel = new JLabel("unable to generate graph: " + e.getMessage()); errorLabel.setForeground(Color.red); jPanel2.removeAll(); jPanel2.add(errorLabel, BorderLayout.NORTH); } jPanel2.revalidate(); // this.repaint(); }