Code example for JLabel

Methods: setBounds

0
		getContentPane().setLayout(new BorderLayout()); 
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 
		getContentPane().add(contentPanel, BorderLayout.CENTER); 
		contentPanel.setLayout(null); 
		 
		JLabel lblFolder = new JLabel("Enter Folder Name: "); 
        lblFolder.setBounds(10, 11, 110, 14); 
		contentPanel.add(lblFolder); 
		 
		textField = new JTextField(); 
		textField.setEditable(true); 
        textField.setBounds(125, 8, 300, 20); 
		contentPanel.add(textField); 
		textField.setColumns(10); 
		 
		/* 
		JButton btnBrowse = new JButton("Browse"); 
		btnBrowse.setBounds(404, 7, 77, 23); 
		btnBrowse.addMouseListener(new MouseAdapter() { 
			@Override 
Experience pair programming with AI  Get Codota for Java