📄 tryapplet.java
字号:
import javax.swing.*;
import java.awt.*;
import javax.swing.border.*; // For the border classes
public class TryApplet extends JApplet
{
public void init()
{
Container content = getContentPane(); // Get content pane
content.setLayout(new FlowLayout(FlowLayout.RIGHT)); // Set layout
JButton button; // Stores a button
Font[] fonts = { new Font("Arial", Font.ITALIC, 10), // Two fonts
new Font("Playbill", Font.PLAIN, 14)
};
BevelBorder edge = new BevelBorder(BevelBorder.RAISED); // Bevelled border
// Add the buttons using alternate fonts
for(int i = 1; i <= 6; i++)
{
content.add(button = new JButton("Press " + i)); // Add the button
button.setFont(fonts[i%2]); // One of our own fonts
button.setBorder(edge); // Set the button border
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -