Java 8 LineBorder - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 LineBorder class.

This code example shows how to use the following methods:
        this.progressBarDecorator = progressBarDecorator;
        resources = new TransferRendererResources();
         
        progressBar = new LimeProgressBar(0, 100);
        updateColor();  
        progressBar.setBorder(new LineBorder(resources.getProgressBarBorderColor()));
        Dimension size = new Dimension(resources.getProgressBarWidth(), resources.getProgressBarHeight());
        progressBar.setMaximumSize(size);
        progressBar.setPreferredSize(size);
         
        timeLabel = new JLabel();
        resources.decorateComponent(timeLabel);
         
        add(progressBar);
        add(timeLabel);
    } 
     
    @Override 
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
            boolean hasFocus, int row, int column) {
5
CodeRank
This code example shows how to use the following methods:
            return false; 
        } 
 
        boolean validValue = validateValue(value);
        if (!validValue) {
            ((JComponent) getComponent()).setBorder(new LineBorder(Color.red));
            return false; 
        } 
 
        if (!super.stopCellEditing()) { 
            ((JComponent) getComponent()).setBorder(new LineBorder(Color.red));
            return false; 
        } 
 
        return true; 
    } 
 
    protected boolean validateValue(float value) {
        return value >= minValue && value <= maxValue;
    } 
5
CodeRank
This code example shows how to use the following methods:
		tree.setLargeModel( true );
		tree.getSelectionModel().setSelectionMode( TreeSelectionModel.SINGLE_TREE_SELECTION );
		tree.setCellRenderer( new GridTreeCellRenderer() );
		tree.setDoubleBuffered( true );
		tree.setOpaque( true );
		tree.setBorder( new LineBorder( Color.BLACK ) );
		 
	} 
 
 
	public void refreshTree() { 
		//TODO 
		//gtm.refreshTree(entries); 
	} 
 
 
	/** 
	 * Clean the table 
	 */ 
	public void clean() { 
4
CodeRank
This code example shows how to use the following methods:
    public void addCustomEntriesToTable(UIDefaults table) {
 
        Border blackLineBorder =
                new BorderUIResource(new LineBorder(getBlack()));
        Border whiteLineBorder =
                new BorderUIResource(new LineBorder(getWhite()));
 
        Object textBorder = new BorderUIResource(new CompoundBorder(
                blackLineBorder,
                new BasicBorders.MarginBorder()));
 
        table.put("ToolTip.border", blackLineBorder);
        table.put("TitledBorder.border", blackLineBorder);
        table.put("Table.focusCellHighlightBorder", whiteLineBorder);
        table.put("Table.focusCellForeground", getWhite());
 
        table.put("TextField.border", textBorder);
        table.put("PasswordField.border", textBorder);
        table.put("TextArea.border", textBorder);
        table.put("TextPane.font", textBorder);
4
CodeRank
This code example shows how to use the following methods:
    } 
    catch (final Exception e)
    { 
      // ignore the exception 
      final JComponent editorComponent = (JComponent) getComponent();
      editorComponent.setBorder(new LineBorder(Color.red));
      return false; 
    } 
    return super.stopCellEditing(); 
  } 
 
  public Component getTableCellEditorComponent(final JTable table,
                                               final Object value, 
                                               final boolean isSelected,
                                               final int row,
                                               final int column)
  { 
    this.value = null;
    final JComponent editorComponent = (JComponent) getComponent();
    editorComponent.setBorder(new LineBorder(Color.black));
4
CodeRank
This code example shows how to use the following methods:
 
    private Component titledImagePanel(String string, RenderedImage expected) {
        JPanel panel = new JPanel(new BorderLayout());
        final JLabel title = new JLabel(string);
        title.setAlignmentX(0.5f);
        title.setBorder(new LineBorder(Color.BLACK));
        panel.add(title, BorderLayout.NORTH);
        panel.add(new ScrollingImagePanel(expected, 400, 400), BorderLayout.CENTER);
        return panel;
    } 
 
    public static boolean show(RenderedImage expected, RenderedImage actual, boolean showCommands) {
        CompareImageDialog dialog = new CompareImageDialog(expected, actual, showCommands);
        dialog.setModal(true);
        dialog.setVisible(true);
 
        return dialog.accept;
    } 
     
} 
5
CodeRank
This code example shows how to use the following methods:
    } 
    catch (final Exception e)
    { 
      // ignore the exception 
      final JComponent editorComponent = (JComponent) getComponent();
      editorComponent.setBorder(new LineBorder(Color.red));
      return false; 
    } 
    return super.stopCellEditing(); 
  } 
 
  public Component getTableCellEditorComponent(final JTable table,
                                               final Object value, 
                                               final boolean isSelected,
                                               final int row,
                                               final int column)
  { 
    this.value = null;
    if (value instanceof GroupedName) 
    { 
4
CodeRank
This code example shows how to use the following methods:
    final Component listCellRendererComponent = renderer.getListCellRendererComponent
        (new JList(), comboBox.getSelectedItem(), comboBox.getSelectedIndex(), false, comboBox.hasFocus());
    if (listCellRendererComponent instanceof JComponent)
    { 
      final JComponent jc = (JComponent) listCellRendererComponent;
      jc.setBorder(new LineBorder(Color.BLACK));
    } 
    return listCellRendererComponent;
  } 
 
  /** 
   * Set the item that should be edited. Cancel any editing if necessary * 
   */ 
  public void setItem(final Object item) 
  { 
    this.item = item;
  } 
 
  /** 
   * Return the edited item * 
4
CodeRank
This code example shows how to use the following methods:
        JFrame frame = new JFrame(System.getProperty("java.version"));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        final JTextArea label = new JTextArea("(empty)");
        label.setSize(400, 300);
        label.setBorder(new LineBorder(Color.black));
        label.setFont(ourFont);
 
        final String str = "\u0F04\u0F05\u0F0D\u0F0D\u0020\u0F4F\u0F72\u0F53\u0F0B\u0F4F\u0F72\u0F53\u0F0B\u0F42\u0FB1\u0F72\u0F0B\u0F51\u0F54\u0F60\u0F0B\u0F62\u0FA9\u0F63";  // TinTin.
 
        if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
            label.setText(str);
        } else { 
        JButton button = new JButton("Set Char x0DDD");
        button.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent actionEvent) {
                label.setText(str);
            } 
        }); 
        panel.add(button);
4
CodeRank
This code example shows how to use the following methods:
        JFrame frame = new JFrame(System.getProperty("java.version"));
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel panel = new JPanel();
        final JTextArea label = new JTextArea("(empty)");
        label.setSize(400, 300);
        label.setBorder(new LineBorder(Color.black));
        label.setFont(ourFont);
        final String str = "\u110A\u119E\u11B7\u0020\u1112\u119E\u11AB\uAE00\u0020\u1100\u119E\u11F9\u0020\u112B\u119E\u11BC\n";
 
        if(AUTOMATIC_TEST) {  /* run the test automatically (else, manually) */
            label.setText(str);
        } else { 
        JButton button = new JButton("Old Hangul");
        button.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent actionEvent) {
                label.setText(str);
            } 
        }); 
        panel.add(button);
        } 
4
CodeRank
See Code Examples for Java 8 LineBorder Methods: