?? button1.java
字號(hào):
/****************************************************************************/
/*********************定義一個(gè)公共的按鈕類以便調(diào)用****************************/
/*****************************************************************************/
import javax.swing.*;
import java.awt.*;
public class Button1 extends JButton
{
Button1(String str)
{
this.setText(str); //設(shè)置內(nèi)容
this.setForeground(new Color(250,0,0)); //設(shè)置字體顏色
this.setBackground(Color.white); //設(shè)置背景色
this.setFont(new Font("宋體",Font.BOLD,20));//設(shè)置字體大小,類型
this.setBorderPainted(true); //設(shè)置邊界可見(jiàn)
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -