请问一下在绘图的时候怎样加粗一条直线??
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class man extends JFrame
{
public static void main(String[] args)
{
man m=new man();
m.setSize(400,350);
m.setLocation(300,180);
woman w=m.new woman();
m.add(w);
m.setVisible(true);
m.setDefaultCloseOperation(man.EXIT_ON_CLOSE);
}
class woman extends JPanel
{
public void put(Graphics g1)
{
g1.fillOval(20,50,20,20);
}
public void paintComponent(Graphics g)
{
Graphics2D g1=(Graphics2D)g;
put(g1);
g1.setColor(Color.red);
g1.drawLine(5,50,50,80);
}
}
}
[此贴子已经被作者于2007-11-10 18:28:53编辑过]