Java Code Examples for javax.swing.JPanel.print()

The following are Jave code examples for showing how to use print() of the javax.swing.JPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: rapidminer   File:   Source Code and License Vote up 7 votes
public void print(Graphics pg) {

	JPanel printPanel = new JPanel() {

		private static final long serialVersionUID = 7315234075649335574L;

		public void paintComponent(Graphics g) {
			Graphics2D g2 = (Graphics2D) g;
	Insets insets = plotEngine.getChartPanel().getInsets();
	int w = plotEngine.getChartPanel().getWidth() - insets.left - insets.right;
	int h = plotEngine.getChartPanel().getHeight() - - insets.bottom;
	printPanel.setSize(new Dimension(w, h));