展开全部
public class YunNian {
public static void main(String[] args) {
new T();
}
}
class T extends JFrame {
public T() {
setBounds(200,100,200,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
@Override
public void paint(Graphics g) {
super.paint(g);
g.drawLine(40,40,100,100);
}
}
public static void main(String[] args) {
new T();
}
}
class T extends JFrame {
public T() {
setBounds(200,100,200,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
@Override
public void paint(Graphics g) {
super.paint(g);
g.drawLine(40,40,100,100);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询