Which of the following statements will display ìHello Worldî in a label named lblMessage?
lblMessage.setLabel(ìHello Worldî);
lblMessage(ìHello Worldî);
lblMessage.setText(ìHello Worldî);
lblMessage.getText(ìHello Worldî

Respuesta :

Answer:

lblMessage.setText("Hello World");

Explanation:

javax.swing.JLabel is used to display a textual element on a user interface. e.g., Suppose you have a panel containing the label "Name:" followed by a textbox to display the name , then the string "Name:" can be displayed on the interface by creating an instance of JLabel. In order to assign the specific text with the JLabel we use the method JLabel.setText(); This method take a string argument corresponding to the actual text to be displayed. In the question this string argument is "Hello World".