Package com.lightcrafts.platform.macosx.test

Source Code of com.lightcrafts.platform.macosx.test.MacPageFormatTest

/* Copyright (C) 2005-2011 Fabio Riccardi */

package com.lightcrafts.platform.macosx.test;

import com.lightcrafts.platform.Platform;
import com.lightcrafts.platform.PrinterLayer;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class MacPageFormatTest {

    static void getPageFormat() {
        Platform platform = Platform.getPlatform();
        PrinterLayer printer = platform.getPrinterLayer();
        printer.getPageFormat();
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(
            new Runnable() {
                public void run() {
                    JButton button = new JButton("getPageFormat()");
                    button.addActionListener(
                        new ActionListener() {
                            public void actionPerformed(ActionEvent e) {
                                getPageFormat();
                            }
                        }
                    );
                    JDialog dialog = new JDialog();
                    dialog.setContentPane(button);
                    dialog.setModal(true);
                    dialog.pack();
                    dialog.setLocationRelativeTo(null);
                    dialog.setVisible(true);

                    System.out.println("setVisible() returned");
                }
            }
        );
    }
}
TOP

Related Classes of com.lightcrafts.platform.macosx.test.MacPageFormatTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.