Code example for TitledBorder

Methods: setTitleColor

0
		initComponents(); 
	} 
 
	private void initComponents() { 
		border = BorderFactory.createTitledBorder("Job progress:");
		border.setTitleColor(Color.gray);
	    setBorder(border);
 
		progress = new JProgressBar(0, 1);
		progress.setValue(1);
		progress.setEnabled(false);
 
	    cancelBtn = new JButton();
	    cancelBtn.setText("Cancel");
	    cancelBtn.setEnabled(false);
	    cancelBtn.addActionListener(new ActionListener() {
			@Override 
			public void actionPerformed(ActionEvent arg0) {
				setInterrupted(); 
			}