你不62616964757a686964616fe58685e5aeb931333330363731要用frame.pack()方法。代码如下:import java.awt.*;importjava.awt.event.*;public class TFMath { public static void main(String[] args) { new TFFrame1().launchFrame(); }}class TFFrame1 extends Frame { TextField num1, num2, num3; public void launchFrame() { num1 = new TextField(10); num2 = new TextField(10); num3 = new TextField(15); Label lblPlus = new Label(\"+\"); Button btnEqual = new Button(\"=\"); btnEqual.addActionListener(new MyMonitor111(this)); setLayout(new FlowLayout()); add(num1); add(lblPlus); add(num2); add(btnEqual); add(num3); //pack(); setVisible(true); }
frame 里面可以去实现,自己写代码,获取位置,计算,