wind520sand
![](images/star2.gif) ![](images/star1.gif) ![](images/star1.gif) ![](images/star1.gif)
发贴: 36
积分: 1
|
于 2005-05-18 00:14
![user profile](images_zh_CN/icons/icon_profile.gif) ![send a private message to user](images_zh_CN/icons/icon_pm.gif) ![search all posts by](images_zh_CN/icons/icon_find.gif) ![select and copy to clipboard.
ie only, sorry for netscape users:-)](images_zh_CN/icons/icon_copy.gif)
import javax.swing.*; import java.awt.*; import java.awt.geom.*; public class MainFrame { public static void main(String[] args) { InitFrame frame = new InitFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.show(); } }
class InitPane extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); g.drawString("一生平安",WIDTH,HEIGHT); g.drawRect(100,100,100,80); } private static final int WIDTH=50; private static final int HEIGHT=50; } class InitFrame extends JFrame { public InitFrame() { setTitle("ok"); setSize(WID,HEI); InitPane pane =new InitPane(); Container contentpane = getContentPane(); contentpane.add(pane); } private static final int WID=500; private static final int HEI=500; } 结果就提示如下了 C:\pro>javac MainFrame.java Note: MainFrame.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 我真是不知道该如何了?才请教大家的啊[:(]
why edited on 2005-05-18 00:24
|