就像我说的那样 - 它编译得很好,但每次我试图运行它时都会给我一个例外。我正在使用NetBeans 3.6和J2SKD 1.4.2。 OK - Here it is: import java.awt.*; public class TestFrame { public static void main(String[] args) { Frame f = new Frame(); f.reshape(10,10,200,200); Button b = new Button("Hello Cyberspace"); b.setBackground(Color.black); b.setForeground(Color.white); f.add(b); f.show(); } } Like I said - it compiles fine, but gives me an exception every time I try to run it. I''m using NetBeans 3.6 and J2SKD 1.4.2. 这个程序编译得很好(虽然有一个弃用警告 reshape( ))并且对我来说运行正常(在Linux上运行JDK 1.4.2_04-b05,没有IDE到 泥泞的水域)。请发布您获得的例外情况。另外,如果你还没有确定NetBeans是否是问题,那么会鼓励你在命令行上尝试这个。 HTH, Ray - XML是程序员的胶带。This program compiles fine (although with a deprecation warning onreshape()) and runs fine for me (JDK 1.4.2_04-b05 on linux, no IDE tomuddy the waters). Please post the exception you are getting. Also, Iwould encourage you to try this on the command line if you haven''talready to determine if NetBeans is the problem.HTH,Ray--XML is the programmer''s duct tape. 这篇关于从Java开始的问题。 。 。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 01:15