Code example for JLabel

Methods: setLabelFor

0
    } 
 
    private JPanel createScriptPanel() {
        scriptField = new JSyntaxTextArea(20,20);
 
        JLabel label = new JLabel(JMeterUtils.getResString("bsh_assertion_script")); //$NON-NLS-1$
        label.setLabelFor(scriptField);
 
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(label, BorderLayout.NORTH);
        panel.add(new JTextScrollPane(scriptField), BorderLayout.CENTER);
 
        JTextArea explain = new JTextArea(JMeterUtils.getResString("bsh_assertion_script_variables")); //$NON-NLS-1$
        explain.setLineWrap(true);
        explain.setEditable(false);
        explain.setBackground(this.getBackground());
        panel.add(explain, BorderLayout.SOUTH);
 
        return panel;
    } 
Connect your IDE to all the code out there  Get Codota for Java