learning java ATW ScrollPane
import java.awt.*; public class ScrollPaneTest { public static void main(String[] args) { var f = new Frame("测试窗口"); var sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS); sp.add(new TextField(20)); sp.add(new Button("click")); f.add(sp); f.setBounds(30,30,300,500); f.setVisible(true); } }
result: