当前位置: 技术问答>java相关
关于awt的小问题,大狭们过来看看啊!!!!!!!!!
来源: 互联网 发布时间:2015-08-03
本文导语: package Calc; import java.awt.*; import java.awt.event.*; import java.awt.Graphics; public class AwtCalc extends Frame implements ActionListener { public AwtCalc() { super("A Calculator"); setBackground(Color.lightGray); re...
package Calc;
import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
public class AwtCalc extends Frame implements ActionListener
{ public AwtCalc()
{ super("A Calculator");
setBackground(Color.lightGray);
resize(235,210);
show();
}
public void actionPerformed(ActionEvent e)
{
}
public void paint(Graphics g)
{ g.drawRect(0,0,size().width-1,size().height-1);
g.drawLine(0,0,0,size().height);
}
public static void main(String args[])
{ AwtCalc ca=new AwtCalc();
}
}
编译后,出现如下提示:
Note:AwtCalc.java uses or overrides a deprecated API.
Note:Recompile with -deprecation for details.
这是什么意思呢?怎么才能运行通过?
注:我用的是JDK1.4
快快帮助我啊,谢谢!
import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
public class AwtCalc extends Frame implements ActionListener
{ public AwtCalc()
{ super("A Calculator");
setBackground(Color.lightGray);
resize(235,210);
show();
}
public void actionPerformed(ActionEvent e)
{
}
public void paint(Graphics g)
{ g.drawRect(0,0,size().width-1,size().height-1);
g.drawLine(0,0,0,size().height);
}
public static void main(String args[])
{ AwtCalc ca=new AwtCalc();
}
}
编译后,出现如下提示:
Note:AwtCalc.java uses or overrides a deprecated API.
Note:Recompile with -deprecation for details.
这是什么意思呢?怎么才能运行通过?
注:我用的是JDK1.4
快快帮助我啊,谢谢!
|
Change a little, then ignore the message of the javac, run it, and I have the windows:
//package Calc;
import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
public class AwtCalc extends Frame implements ActionListener
{ public AwtCalc()
{ super("A Calculator");
setBackground(Color.lightGray);
resize(235,210);
show();
}
public void actionPerformed(ActionEvent e)
{
}
public void paint(Graphics g)
{ g.drawRect(0,0,size().width-1,size().height-1);
g.drawLine(0,0,0,size().height);
}
public static void main(String args[])
{ AwtCalc ca=new AwtCalc();
}
}
//package Calc;
import java.awt.*;
import java.awt.event.*;
import java.awt.Graphics;
public class AwtCalc extends Frame implements ActionListener
{ public AwtCalc()
{ super("A Calculator");
setBackground(Color.lightGray);
resize(235,210);
show();
}
public void actionPerformed(ActionEvent e)
{
}
public void paint(Graphics g)
{ g.drawRect(0,0,size().width-1,size().height-1);
g.drawLine(0,0,0,size().height);
}
public static void main(String args[])
{ AwtCalc ca=new AwtCalc();
}
}