Code example for JLabel

Methods: setLabelFor

0
        VerticalPanel loopPanel = new VerticalPanel();
 
        // LOOP LABEL 
        JLabel inputValLabel = new JLabel(JMeterUtils.getResString("foreach_input")); // $NON-NLS-1$
        JLabel startIndexLabel = new JLabel(JMeterUtils.getResString("foreach_start_index")); // $NON-NLS-1$
        JLabel endIndexLabel = new JLabel(JMeterUtils.getResString("foreach_end_index")); // $NON-NLS-1$
        JLabel returnValLabel = new JLabel(JMeterUtils.getResString("foreach_output")); // $NON-NLS-1$
 
        // TEXT FIELD 
        JPanel inputValSubPanel = new JPanel(new BorderLayout(5, 0));
        inputVal = new JTextField("", 5); // $NON-NLS-1$
        inputVal.setName(INPUTVAL);
        inputValLabel.setLabelFor(inputVal);
        inputValSubPanel.add(inputValLabel, BorderLayout.WEST);
        inputValSubPanel.add(inputVal, BorderLayout.CENTER);
 
        // TEXT FIELD 
        JPanel startIndexSubPanel = new JPanel(new BorderLayout(5, 0));
        startIndex = new JTextField("", 5); // $NON-NLS-1$
        startIndex.setName(START_INDEX);
        startIndexLabel.setLabelFor(startIndex);
        startIndexSubPanel.add(startIndexLabel, BorderLayout.WEST);
        startIndexSubPanel.add(startIndex, BorderLayout.CENTER);
 
        // TEXT FIELD 
        JPanel endIndexSubPanel = new JPanel(new BorderLayout(5, 0));
        endIndex = new JTextField("", 5); // $NON-NLS-1$
        endIndex.setName(END_INDEX);
        endIndexLabel.setLabelFor(endIndex);
        endIndexSubPanel.add(endIndexLabel, BorderLayout.WEST);
        endIndexSubPanel.add(endIndex, BorderLayout.CENTER);
 
        // TEXT FIELD 
        JPanel returnValSubPanel = new JPanel(new BorderLayout(5, 0));
Contextual code suggestions in your IDE  Get Codota for Java