subject

Analyze the following code.

import java. awt.*;
import javax. swing.*;

public class Test {
public static void main(String[] args) {
JFrame frame = new JFrame("My Frame");
frame. add(new MyDrawing("Welcome to Java!"));
frame. setSize(300, 300);
frame. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
frame. setVisible(true);
frame. setVisible(true);
}
}

class MyDrawing extends JPanel {
String message;

public MyDrawing(String message) {
this. message = message;
}

public void paintcomponent(Graphics g) {
super. paintComponent(g);

g. drawString(message, 20 ,20);
}
}

What happens?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Adrawing that places all lines parallel to the z axis at an angle from the horizon is 99 ! a. an oblique drawing b. a perspective drawing c. an auxiliary view d. a one-point perspective drawing
Answers: 2
question
Computers and Technology, 24.06.2019 16:00
Your is an example of personal information that you should keep private.
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
Website hosting servers have their own unique ip address, what does this address consist of? a. numbers and letters b. numbers c. letters d. letters and symbols
Answers: 2
You know the right answer?
Analyze the following code.

import java. awt.*;
import javax. swing.*;

...
Questions
question
Mathematics, 31.08.2019 00:30
question
Mathematics, 31.08.2019 00:30
question
Mathematics, 31.08.2019 00:30
Questions on the website: 13722361