simpleapplet.java

来自「java swing 开发代码」· Java 代码 · 共 22 行

JAVA
22
字号
// SimpleApplet.java// An example of the JApplet class.  For use with the applet.html file.//package	jswing.ch08;import javax.swing.*;import java.awt.*;public class SimpleApplet extends JApplet {  public void init() {    JPanel p = new JPanel();    p.setLayout(new GridLayout(2, 2, 2, 2));    p.add(new JLabel("Username"));    p.add(new JTextField());    p.add(new JLabel("Password"));    p.add(new JPasswordField());    Container content = getContentPane();    content.setLayout(new GridBagLayout()); // Used to center the panel    content.add(p);  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?