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

This code example shows how to use the following methods:setTitle
 
    private TitledBorder border;
    private String title = "";
 
    public PropertyPanel() { 
        border = new TitledBorder("");
        setBorder(border);
    } 
 
    public PropertyPanel(String title) {
        this(); 
        this.title = title;
        border.setTitle(title);
    } 
 
    public PropertyPanel(PropertyProvider provider) {
        this(); 
        setActivePropertyProvider(provider);
    } 
 
6
CodeRank
This code example shows how to use the following methods:setTitleColor, setTitleFont, setTitleJustification, setTitlePosition
    } 
 
    public TitledSeparator(String title, int titleJustification,
                            int titlePosition, Font titleFont, Color titleColor)
    { 
        this.titledBorder = new TitledBorder(null, title);
        setTitleJustification(titleJustification);
        setTitlePosition(titlePosition);
        setTitleFont(titleFont);
        setTitleColor(titleColor);
    } 
 
    public int getTitlePosition() 
    { 
        return titledBorder.getTitlePosition();
    } 
 
    public int getTitleJustification() 
    { 
        return titledBorder.getTitleJustification();

6
CodeRank
This code example shows how to use the following methods:setTitle
        onActivePropertyChanged(); 
    } 
 
    public void onActivePropertyChanged() { 
        if (activeProperty != null) {
            titledBorder.setTitle(activeProperty.getTitle());
            if (activeProperty.getValueType() == Float.class) {
                setValue(activeProperty.getValue(), activeProperty.getMinValue(), activeProperty.getMaxValue());
            } 
        } 
    } 
 
    public void setValue(float value, float minValue, float maxValue) {
        int sliderValue = (int) (((value - minValue) / (maxValue - minValue)) * 100.0f);
        slider.setValue(sliderValue);
    } 
 
    @Override 
    public void stateChanged(ChangeEvent e) {
        if (activeProperty.getValueType() == Float.class) {
5
CodeRank
This code example shows how to use the following methods:setTitlePosition
public class Test4247606 extends JApplet {
    public void init() { 
        JButton button = new JButton("Button"); // NON-NLS: the button text
        button.setBorder(BorderFactory.createLineBorder(Color.red, 1));
 
        TitledBorder border = new TitledBorder("Bordered Pane"); // NON-NLS: the panel title
        border.setTitlePosition(TitledBorder.BELOW_BOTTOM);
 
        JPanel panel = create(button, border);
        panel.setBackground(Color.green);
 
        getContentPane().add(create(panel, BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    } 
 
    private static JPanel create(JComponent component, Border border) {
        JPanel panel = new JPanel(new BorderLayout());
        panel.setBorder(border);
        panel.add(component);
        return panel;
    } 
5
CodeRank
This code example shows how to use the following methods:getTitle, getTitleFont, getTitleJustification, getTitlePosition
    TestCase.assertNotNull("JPanel pnl auto bound through Swixml", pnl);
    Border border = pnl.getBorder();
    TestCase.assertNotNull("panel elem. has a border attribute def. in the XML Descriptor", border);
    TestCase.assertTrue("XML Descriptor declared a TitledBorder for this Panel", border.getClass().isAssignableFrom(TitledBorder.class));
    TitledBorder tb = (TitledBorder) border;
    TestCase.assertEquals("Title like set in XML", "myTitle", tb.getTitle());
    TestCase.assertEquals("Title Font like set in XML", Font.decode("VERDANA-BOLD-18"), tb.getTitleFont());
    TestCase.assertEquals("Title Justification like set in XML", TitledBorder.CENTER, tb.getTitleJustification());
    TestCase.assertEquals("Title Position like set in XML", TitledBorder.BELOW_BOTTOM, tb.getTitlePosition());
  } 
} 
5
CodeRank
This code example shows how to use the following methods:
        setLayout(theLayout);
    } 
 
    private void createLayout() { 
        ruleScrollPane = new HelpableJScrollPane();
        ruleScrollPane.setBorder(new TitledBorder(ServiceProvider.getInstance().getLocaleService().getTranslatedString("ViolationsPerRuleTotalTitle")));
        violationsScrollPane = new HelpableJScrollPane();
        violationsScrollPane.setBorder(new TitledBorder(ServiceProvider.getInstance().getLocaleService().getTranslatedString("Violations")));
 
        theLayout = new GroupLayout(this);
        theLayout.setHorizontalGroup(theLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(theLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(theLayout.createParallelGroup(Alignment.TRAILING)
	                .addComponent(ruleScrollPane, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE)
	                .addComponent(violationsScrollPane, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 497, Short.MAX_VALUE))
                .addContainerGap())); 
        theLayout.setVerticalGroup(theLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(theLayout.createSequentialGroup()
                .addContainerGap()
5
CodeRank
This code example shows how to use the following methods:setBorder, setTitleColor, setTitleJustification, setTitlePosition
            border = BorderFactory.createCompoundBorder(
                    border, BorderFactory.createLineBorder(Color.RED, 1));
        } 
        // and add any parameter information 
        if (_parameterLabel != null) {
            TitledBorder tb = new TitledBorder(_parameterLabel);
            tb.setTitleJustification(TitledBorder.TRAILING);
            tb.setTitleColor(Color.BLUE);
            if (border != null) {
                // replace the standard "etched" border in the title with the existing border 
                tb.setTitlePosition(TitledBorder.ABOVE_TOP);
                tb.setBorder(border);
            } 
            border = tb;
        } 
 
        return border; // ok to return null
    } 
 
    /** 
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
		gridBagConstraints.weightx = 1.0;
		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
		selectorPanel.add(datasourceSelector, gridBagConstraints);
 
		selectorPanel.setBorder(new TitledBorder("Datasource selection"));
		queryPanel.setBorder(new TitledBorder("SQL Query Editor"));
 
		setLayout(new BorderLayout());
		add(queryPanel, BorderLayout.CENTER);
		add(selectorPanel, BorderLayout.NORTH);
 
		log.debug("SQL Query view initialized"); 
	} 
 
	@Override 
	public void activeOntologyChanged() { 
		datasourceSelector.setDatasourceController(apic.getActiveOBDAModel());
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
 
	private void createWholeApplicationPanel() { 
        FlowLayout flowLayout1 = (FlowLayout) this.getLayout();
        flowLayout1.setAlignment(FlowLayout.LEFT);
        this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
        this.setBorder(new TitledBorder(dataControl.translate("FullApplication")));
		totalPackagesLabel = new JLabel();
		totalPackagesNumber = new JLabel("-");
		totalClassesLabel = new JLabel();
		totalClassesNumber = new JLabel("-");
		totalLinesOfCodeLabel = new JLabel();
		totalLinesOfCodeNumber = new JLabel("-");
		nrOfDependenciesLabel = new JLabel();
		nrOfDependenciesNumber = new JLabel("-");
		emtyLabelSettingTheSize1 = new JLabel("");
		emtyLabelSettingTheSize2 = new JLabel("");
	} 
 
	private void createLayout() { 
		groupLayout = new GroupLayout(this);
5
CodeRank
See Code Examples for Java 8 TitledBorder Methods: