Analyze the following code.
import java. awt.*;
import javax. swing.*;
...
Computers and Technology, 25.03.2020 18:51, arnold2619
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?
Answers: 3
Computers and Technology, 21.06.2019 17:00, norsenorma
In addition to using the icons to adjust page margins, a user can also use
Answers: 1
Computers and Technology, 21.06.2019 18:30, porkhappycom
Which number on the image above correctly indicates the name of a folder in this url? a.1b.2c.3d.4
Answers: 2
Computers and Technology, 22.06.2019 23:30, lexirandall19
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
Mathematics, 27.07.2019 07:50