Code example for JLabel

Methods: getFontsetFont

0
		this.setSize(400, 800);
		this.setLayout(new BorderLayout());
		JPanel topPanel = new JPanel(new BorderLayout());
		statusIcon = new JLabel();
		topPanel.add(statusIcon, BorderLayout.WEST);
		chatName = new JLabel();
		chatName.setFont(FontUtils.emSize(chatName.getFont(), 2));
		topPanel.add(chatName, BorderLayout.CENTER);
		this.add(topPanel, BorderLayout.NORTH);
 
		chatComponent = new ChatComponent();
 
		this.add(chatComponent, BorderLayout.CENTER);
		this.setVisible(true);
	} 
	 
	public MessageListener getMessageListener() { return chatComponent; }
 
	public void addLine(String line) {
		chatComponent.addLine(line);
Experience pair programming with AI  Get Codota for Java