import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;public class CricleTest
{
public static void main(String[] args)
{
CricleFrame frame = new CricleFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
class CricleFrame extends JFrame
{
public CricleFrame()
{
setTitle("Cricle");
setSize(WIDTH, HEIGHT); CriclePanel panel = new CriclePanel();
Container contentPane = getContentPane();
contentPane.add(panel);
} public static final int WIDTH = 400;
public static final int HEIGHT = 400;
}
class CriclePanel extends JPanel
{
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g; g.drawOval(100,100,100,100);
}
}
import java.awt.geom.*;
import javax.swing.*;public class CricleTest
{
public static void main(String[] args)
{
CricleFrame frame = new CricleFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
class CricleFrame extends JFrame
{
public CricleFrame()
{
setTitle("Cricle");
setSize(WIDTH, HEIGHT); CriclePanel panel = new CriclePanel();
Container contentPane = getContentPane();
contentPane.add(panel);
} public static final int WIDTH = 400;
public static final int HEIGHT = 400;
}
class CriclePanel extends JPanel
{
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g; g.drawOval(100,100,100,100);
}
}
解决方案 »
- jquery ajax 接受值 alert弹出整个页面
- MyEclipse究竟怎么查看错误
- ant到底是做什么用的
- 刚进公司,居然让我搞测试,请教各位大神测试的原理?
- MyEclipse8如何实现自动创建struts2的action的Java(或class类)文件啊?
- the jar file commons-logging-1.0.4.jar has no source attachment
- 为什么只能看到接口,看不到具体的实现???
- servlet入门程序老运行不了,大虾进来帮看看环境变量哇~55555555555
- 在java中有没有计算表达式的函数!!!
- EJB成功发布后的问题。。。头都大了
- 小弟不才,提问JavaMail问题,100相送各路大侠!
- tomcat5.0.25+DB2,无法进行数据库的连接,提示驱动无法找到
import javax.swing.*;
import java.awt.geom.*;public class myFrame extends Frame
{
public myFrame()
{
this.super("Cricle");
this.setSize(300,300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.drawOval(100,100,100,100);
}
public static void main(String args[])
{
myFrame t1 = new myFrame();
}
}