Package java.awt

Examples of java.awt.Frame$AllFrames


     * @return java.awt.Frame
     */
    private Frame getMessageFrame() {
        if (iMessageFrame == null) {
            try {
                iMessageFrame = new Frame();
                iMessageFrame.setName("MessageFrame");
                iMessageFrame.setLayout(new BorderLayout());
                iMessageFrame.setBounds(0, 0, 750, 250);
                iMessageFrame.setTitle("Message Log");
                iMessageFrame.add(getMessageContentPanel(), "Center");
View Full Code Here


    private static final DateFormat FORMAT = new SimpleDateFormat("yyyyMMdd-HHmmss-SSS");
    private static final Font TEXT_FONT = new Font("SansSerif", Font.PLAIN, 10);
    private static final Font TITLE_FONT = new Font("SansSerif", Font.BOLD, 12);

    public static void print(final String title, final String text) {
        final Frame parent = new Frame();
        final PrintJob job = Toolkit.getDefaultToolkit().getPrintJob(parent, "Print " + title, new Properties());

        if (job != null) {
            final Graphics graphic = job.getGraphics();
            // Dimension pageSize = job.getPageDimension();

            if (graphic != null) {
                graphic.translate(10, 10);
                final int x = 50;
                int y = 50;

                graphic.setFont(TITLE_FONT);

                final int height = graphic.getFontMetrics().getAscent();
                final int width = graphic.getFontMetrics().stringWidth(title);
                graphic.drawRect(x - 10, y - 10 - height, width + 20, height + 20);

                graphic.drawString(title, x, y);

                y += graphic.getFontMetrics().getHeight();
                y += 20;

                graphic.setFont(TEXT_FONT);
                final StringTokenizer tk = new StringTokenizer(text, "\n\r");
                while (tk.hasMoreTokens()) {
                    final String line = tk.nextToken();
                    graphic.drawString(line, x, y);
                    y += graphic.getFontMetrics().getHeight();
                }

                graphic.dispose();
            }

            job.end();
        }
        parent.dispose();
    }
View Full Code Here

        return Allow.DEFAULT;
    }

    @Override
    public void execute(final Workspace workspace, final View view, final Location at) {
        final Frame frame = new Frame();
        final PrintJob job = Toolkit.getDefaultToolkit().getPrintJob(frame, "Print object", null);

        if (job != null) {
            final Graphics pg = job.getGraphics();
            final Dimension pageSize = job.getPageDimension();

            if (pg != null) {
                pg.translate(LEFT, HEIGHT);
                pg.drawRect(0, 0, pageSize.width - LEFT - 1, pageSize.height - HEIGHT - 1);
                view.print(new PrintCanvas(pg, view));
                pg.dispose();
            }

            job.end();
        }
        frame.dispose();
    }
View Full Code Here

            throw new IsisException(e);
        }
    }

    public static void saveToFile(final String saveDialogTitle, final String title, final String text) {
        final Frame parent = new Frame();

        final FileDialog dialog = new FileDialog(parent, saveDialogTitle, FileDialog.SAVE);
        dialog.setVisible(true);
        final String file = dialog.getFile();
        final String dir = dialog.getDirectory();

        parent.dispose();

        saveToFile(new File(dir, file), title, text);
    }
View Full Code Here

    }
  }

  protected JDialog createDialog(Component parent)
  {
    Frame frame = parent instanceof Frame ? (Frame) parent
      : (Frame) SwingUtilities.getAncestorOfClass(Frame.class, parent);
    JDialog dialog = new JDialog(frame, _("SelectFont"), true);

    Action okAction = new DialogOKAction(dialog);
    Action cancelAction = new DialogCancelAction(dialog);
View Full Code Here

public class SplashFrame extends JWindow {

    private static Thread animator;

    public SplashFrame() {
        super(new Frame());

        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Image image = toolkit.getImage(MainFrame.class.getResource("SplashBug1.png"));
        Image image2 = toolkit.getImage(MainFrame.class.getResource("SplashBug2B.png"));
        Image imageReverse = toolkit.getImage(MainFrame.class.getResource("SplashBug1reverse.png"));
View Full Code Here

  static void help() {
    System.out.println("Chat [-help] [-props <properties>]");
  }

  public void start() {
    mainFrame = new Frame();
    mainFrame.setLayout(null);
    mainFrame.setSize(600, 507);
    mainFrame.addWindowListener(this);

    txtArea = new TextArea();
View Full Code Here

     * @return java.awt.Frame
     */
    private Frame getMessageFrame() {
        if (iMessageFrame == null) {
            try {
                iMessageFrame = new Frame();
                iMessageFrame.setName("MessageFrame");
                iMessageFrame.setLayout(new BorderLayout());
                iMessageFrame.setBounds(0, 0, 750, 250);
                iMessageFrame.setTitle("Message Log");
                iMessageFrame.add(getMessageContentPanel(), "Center");
View Full Code Here

* @author Levente S?ntha
*/
public class GraphicsTest {
    public static void main(String[] args)
        throws Exception {
        Frame wnd = new Frame();
        try {
            wnd.setSize(600, 400);
            wnd.add(new TestComponent());
            wnd.show();

            Thread.sleep(5000);

            wnd.hide();
        } finally {
            wnd.dispose();
        }
    }
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                System.out.println("Action on b2");
                if (sb.getValue() + sb.getBlockIncrement() <= sb.getMaximum()) {
                    sb.setValue(sb.getValue() + sb.getBlockIncrement());
                } else {
                    Frame f2 = new Frame("New frame");
                    f2.setSize(200, 100);
                    f2.setVisible(true);
                }
            }
        });

        add(cb1, BorderLayout.EAST);
View Full Code Here

TOP

Related Classes of java.awt.Frame$AllFrames

Copyright © 2018 www.massapicom. 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.