Code example for JLabel

Methods: setLabelFor

0
    } 
 
    private JPanel getConnectTimeOutPanel() {
        connectTimeOut = new JTextField(4);
 
        JLabel label = new JLabel(JMeterUtils.getResString("web_server_timeout_connect")); // $NON-NLS-1$
        label.setLabelFor(connectTimeOut);
 
        JPanel panel = new JPanel(new BorderLayout(5, 0));
        panel.add(label, BorderLayout.WEST);
        panel.add(connectTimeOut, BorderLayout.CENTER);
 
        return panel;
    } 
 
    private JPanel getResponseTimeOutPanel() {
        responseTimeOut = new JTextField(4);
 
        JLabel label = new JLabel(JMeterUtils.getResString("web_server_timeout_response")); // $NON-NLS-1$
        label.setLabelFor(responseTimeOut);
Connect your IDE to all the code out there  Get Codota for Java