?? shus.java
字號(hào):
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class shus extends Applet implements ActionListener
{
Label lili; //biaoqian
TextField input1;
public void init()
{
lili =new Label("Enter one numbers,press enter!");
input1 =new TextField(5);//創(chuàng)建文本編輯框
add(lili);//將標(biāo)簽加入圖形界面
add(input1);
input1.addActionListener(this);
}
public void paint(Graphics g)
{
int a,b=0;
a=Integer.parseInt(input1.getText());
for(int i = 2;i<a;i++)
{
for(int j=2;j<a;j++)
{
if(a==j*i)
{
b=1+b;
g.drawString("the"+b,60,80);
break;
}
}
}
if(b<=0)
{
g.drawString("theisT",40,80);
}
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == input1)
repaint();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -