Java 8 JSeparator - 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 JSeparator class.

This code example shows how to use the following methods:setAlignmentX, setBorder
This code example shows how to use the following methods:
    		p.add(UIUtilities.buildComponentPanel(
    				UIUtilities.setTextFont("Select the group(s) to add the " + 
    				"User to"))); 
    		p.add(selectionComponent);
    		c.gridy++;
    		add(new JSeparator(), c);
    		c.gridy++;
    		add(p, c);
    	} 
    } 
 
    /**  
     * Creates a new instance.  
     *  
     * @param passwordRequired 	Pass <code>true</code> to indicate that a 
     * 							password is required, <code>false</code> 
     * 							otherwise. 
     * @param groups			The available groups. 
     * @param selected			The selected groups. 
     */ 
5
CodeRank
This code example shows how to use the following methods:getParent, getOrientation
	public void paint(Graphics g, JComponent c) {
		Graphics2D graphics = (Graphics2D) g.create();
 
		JSeparator sep = (JSeparator) c;
 
		int xOffset = MenuUtilities.getTextOffset(sep, sep.getParent());
		SubstanceMenuBackgroundDelegate.paintBackground(graphics, c, xOffset);
 
		Dimension s = c.getSize();
		int startX = 0;
		int width = s.width;
		if (c.getComponentOrientation().isLeftToRight()) {
			startX = xOffset - 2;
			width = s.width - startX;
		} else { 
			startX = 0;
			if (xOffset > 0) {
				width = xOffset - 4;
			} else { 
				width = s.width;

5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    private boolean closable = false;
    private CloseListener closeListener = null;
 
    public void enableClosable(CloseListener listener) {
        if (!closable) {
            popupMenu.insert(new JSeparator(), 0);
            popupMenu.insert(menuCloseTab, 0);
        } 
        closeListener = listener;
        this.closable = true;
    } 
 
    public void disableClosable() { 
        if (closable) {
            popupMenu.remove(0);
            popupMenu.remove(0);
        } 
        closeListener = null;
        this.closable = false;
    } 
2
CodeRank
This code example shows how to use the following methods:
		file.add(open);
		file.add(new JSeparator());
		file.add(importArchive);
		file.add(exportArchive);
		file.add(update);
		file.add(new JSeparator());
		file.add(close);
		file.add(quit);
		bar.add(file);
 
		JMenu view = new JMenu(Messages.getString("MainActivity.6")); //$NON-NLS-1$
		view.setMnemonic(KeyStroke.getKeyStroke(Messages.getString("MainActivity.15")).getKeyCode()); //$NON-NLS-1$
		search = new JMenuItem(
				Messages.getString("MainActivity.7"), KeyStroke.getKeyStroke(Messages.getString("MainActivity.26")).getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$
		search.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit.getDefaultToolkit()
				.getMenuShortcutKeyMask()));
		downloads = new JMenuItem(
				Messages.getString("MainActivity.8"), KeyStroke.getKeyStroke(Messages.getString("MainActivity.27")).getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$
		downloads.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit.getDefaultToolkit()
				.getMenuShortcutKeyMask()));
3
CodeRank
This code example shows how to use the following methods:
            JButton button = new JButton("OK");
            button.addActionListener(new UpdateStylePanelAction());
 
            jContentPane.add(button);
 
            jContentPane.add(new JSeparator());
 
            jContentPane.add(panel);
        } 
        return jContentPane;
    } 
 
    /** 
     * <p> 
     * This method initializes StylePanel. 
     * </p> 
     * 
     * @return the style panel. 
     */ 
    public StylePanel getStylePanel() { 
3
CodeRank
This code example shows how to use the following methods:
        this.label = new JLabel(text);
        add(this.label, c);
        c.insets.left = 5;
        c.weightx = 1;
        c.gridx++;
        final JSeparator separator = new JSeparator();
        SwingUtils.setPreferredWidth(separator, 64);
        add(separator, c);
    } 
 
    /** 
     * Returns the label text. 
     * 
     * @return The label text 
     */ 
    public String getText()
    { 
        return this.label.getText();
    } 
 
5
CodeRank
This code example shows how to use the following methods:
	private void buildUI() 
	{ 
		 JPanel panel = new JPanel(new MigLayout("fill","[80][80][80]","[20]"));
		 JLabel dimLabel = new JLabel(VueResources.getString("htmloutput.dimensions"));
		 panel.add(dimLabel,"gaptop 3");
		 panel.add(new JSeparator(),       "growx, wrap, gaptop 3");
		 panel.add(widthLabel,"gap 10");
		 panel.add(widthField,"growx");
		 panel.add(widthPixels,"gap 10, wrap");
		 panel.add(heightLabel,"gap 10");
		 panel.add(heightField,"growx");		 
		 panel.add(heightPixels,"gap 10, wrap");
		 panel.add(formatLabel,"gap 10");
		 formatBox.addItem("PNG");		 
		 formatBox.addItem("JPEG");
		 panel.add(formatBox,"gap 10, wrap");
		  
		 
		 JPanel p = new JPanel(new MigLayout(""));
		 p.add(cancelButton, "sg, tag cancel");
3
CodeRank
This code example shows how to use the following methods:
		gc.fill = GridBagConstraints.BOTH;
		gc.weightx = 1;
		gc.gridwidth=GridBagConstraints.REMAINDER;
		gc.anchor = GridBagConstraints.NORTH;
 
		JSeparator sep = new JSeparator();
		super.add(sep);
		oGridBagLayout.setConstraints(sep, gc);
	} 
 
	/** 
	 * Add the given button on the left of the panel. 
	 * 
	 * @param oButton - the button to be added; 
	 */ 
	public void addButton(UIButton oButton) {
		GridBagConstraints gc = new GridBagConstraints();
		gc.fill = GridBagConstraints.NONE;
		gc.insets = new Insets(10,10,10,10);
		gc.weightx = 1;
3
CodeRank
See Code Examples for Java 8 JSeparator Methods: