Code example for JLabel

Methods: setBorder

0
     * @param host 
     *            the host where JMeter threads are stopping 
     */ 
    public void showStoppingMessage(String host) {
        stoppingMessage = new JDialog(this, JMeterUtils.getResString("stopping_test_title"), true);// $NON-NLS-1$
        JLabel stopLabel = new JLabel(JMeterUtils.getResString("stopping_test") + ": " + host);// $NON-NLS-1$
        stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
        stoppingMessage.getContentPane().add(stopLabel);
        stoppingMessage.pack();
        ComponentUtil.centerComponentInComponent(this, stoppingMessage);
        SwingUtilities.invokeLater(new Runnable() {
            @Override 
            public void run() { 
                if (stoppingMessage != null) {
                    stoppingMessage.setVisible(true);
                } 
            } 
        }); 
    } 
 
Contextual code suggestions in your IDE  Get Codota for Java