R
raider
Unregistered / Unconfirmed
GUEST, unregistred user!
我在看以前的java1.1的书,上面提到 BorderLayout ,
可是我在调程序时老是错,
Class BorderLayout not found.
setLayout(new BorderLayout());
而且我在用VCafe4.0时,也看不到有什么布局之类的东东
是不是这个概念在java2中取消了?那么用什么实现类似的
功能呢?
source code:
import java.applet.*;
import java.awt.*;
// Example 29.8 - BorderLayoutApplet
//
// This applet creates a BorderLayout and attaches it
// to the applet. then
it creates buttons and places
// in all possible areas of the layout.
public class BorderLayoutApplet extends Applet
{
public void init()
{
// First create the layout and attach it to the applet
setLayout(new BorderLayout());
// Now create some buttons and lay them out
add("North", new Button("Larry"));
add("South", new Button("Curly Joe"));
add("East", new Button("Curly"));
add("West", new Button("Shemp"));
add("Center", new Button("Moe"));
}
}
可是我在调程序时老是错,
Class BorderLayout not found.
setLayout(new BorderLayout());
而且我在用VCafe4.0时,也看不到有什么布局之类的东东
是不是这个概念在java2中取消了?那么用什么实现类似的
功能呢?
source code:
import java.applet.*;
import java.awt.*;
// Example 29.8 - BorderLayoutApplet
//
// This applet creates a BorderLayout and attaches it
// to the applet. then
it creates buttons and places
// in all possible areas of the layout.
public class BorderLayoutApplet extends Applet
{
public void init()
{
// First create the layout and attach it to the applet
setLayout(new BorderLayout());
// Now create some buttons and lay them out
add("North", new Button("Larry"));
add("South", new Button("Curly Joe"));
add("East", new Button("Curly"));
add("West", new Button("Shemp"));
add("Center", new Button("Moe"));
}
}