📄 hellorevisited.java
字号:
import javax.swing.JFrame;import java.awt.*;/** This program adds a Hello World message to a filled green * oval in the center of a JFrame. */public class HelloRevisited { public static void main( String[] args ) { JFrame window = new JFrame("Hello World"); window.setBounds(10, 10, 400, 400); window.setVisible(true); window.setLayout(null); Oval dot = new Oval(100, 100, 200, 200); dot.setBackground(Color.green); dot.repaint(); window.add(dot, 0); Label helloMsg = new Label("Hello World!"); helloMsg.setBounds(20, 85, 160, 30); helloMsg.setAlignment(Label.CENTER); helloMsg.repaint(); dot.add(helloMsg, 0); window.repaint(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -