📄 scrollpane.java
字号:
import java.applet.Applet;
import java.awt.*;
/*
<APPLET
CODE=scrollpane.class
WIDTH=200
HEIGHT=200 >
</APPLET>
*/
public class scrollpane extends Applet
{
ScrollPane scrollpane1;
TextPanel t1;
public void init(){
scrollpane1 = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
t1 = new TextPanel();
scrollpane1.add(t1);
add(scrollpane1);
}
}
class TextPanel extends Panel
{
public Dimension getPreferredSize()
{
return new Dimension(400, 400);
}
public void paint (Graphics g)
{
g.drawString ("This is a long string of text that just " +
"seems to go on and on and on and on....", 0, 60);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -