当前位置: 技术问答>java相关
又一个java初级问题,送分。
来源: 互联网 发布时间:2015-01-10
本文导语: 源代码如下: import java.awt.*; import java.awt.event.*; import java.applet.Applet; public class ScrollComponents extends Applet { private ScrollPane scroller; private ManyLabelPanel labels; private ManyButtonPanel buttons; public void init() { setCurso...
源代码如下:
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class ScrollComponents extends Applet
{
private ScrollPane scroller;
private ManyLabelPanel labels;
private ManyButtonPanel buttons;
public void init()
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
labels=new ManyLabelPanel();
buttons=new ManyButtonPanel();
scroller=new ScrollPane();
scroller.add(labels);
setLayout(new BorderLayout());
add(new TogglePanel(scroller,labels,buttons),"North");
add(scroller,"Center");
}
public void start()
{
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
class ManyLabelPanel extends Panel
{
public ManyLabelPanel()
{
setLayout(new GridLayout(4,0,10,10));
for (int i=0;i
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class ScrollComponents extends Applet
{
private ScrollPane scroller;
private ManyLabelPanel labels;
private ManyButtonPanel buttons;
public void init()
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
labels=new ManyLabelPanel();
buttons=new ManyButtonPanel();
scroller=new ScrollPane();
scroller.add(labels);
setLayout(new BorderLayout());
add(new TogglePanel(scroller,labels,buttons),"North");
add(scroller,"Center");
}
public void start()
{
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
class ManyLabelPanel extends Panel
{
public ManyLabelPanel()
{
setLayout(new GridLayout(4,0,10,10));
for (int i=0;i