我需要制作一个Java 6,640*480像素的applet,底部有一个带有一些按钮,滚动条和标签的工具栏.我能想到的最好的方法是使用a BorderLayout,使BorderLayout.SOUTH区域成为a GridBagLayout(包含控件),其余BorderLayout区域为null,作为用控件绘制图形的地方.我在网上找不到任何不使用swing的资源,而且我不知道有什么关于swing来推断他们正在做什么或如何将它翻译成awt代码.这是我现在的位置.代码突然结束init(),因为这是布局管理器开始的地方.感谢您的帮助.如果您需要更多信息,请告知我们.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Bounce extends Applet implements ActionListener, AdjustmentListener
{
private static final long serialVersionUID = 1L;
private Graphics page;
//buttons
String shapeButtonText = "Square";
Button shape = new Button(shapeButtonText);
Button quit = new Button("Quit");
Button run = new Button("Run");
Button tail = new Button("Tail");
Button clear = new Button("Clear");
//labels
Label speedLabel = new Label("Speed", Label.CENTER);
Label sizeLabel = new Label("Size", Label.CENTER); …Run Code Online (Sandbox Code Playgroud)