- 讲师:刘萍萍 / 谢楠
- 课时:160h
- 价格 4580 元
特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关
配套通关班送国网在线题库一套
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.print.*;
import java.util.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.swing.*;
/**
This program demonstrates how to print 2D graphics
*/
public class PrintTest
{
public static void main(String[] args)
{
JFrame frame = new PrintTestFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
/**
This frame shows a panel with 2D graphics and buttons
to print the graphics and to set up the page format.
*/
class PrintTestFrame extends JFrame
{
public PrintTestFrame()
{
setTitle("PrintTest");
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
canvas = new PrintPanel();
add(canvas, BorderLayout.CENTER);
attributes = new HashPrintRequestAttributeSet();
JPanel buttonPanel = new JPanel();
JButton printButton = new JButton("Print");
buttonPanel.add(printButton);
责编:罗莉
上一篇:排列组合算法的java实现
下一篇:Java程序性能优化(1)
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
课程专业名称 |
讲师 |
课时 |
查看课程 |
---|
点击加载更多评论>>