Examples of Frame


Examples of java.awt.Frame

        if (javaVersion < 1.4) {
            System.err.println("Java version 1.4 or later is required to run this program.");
            System.err.println("Please download it from http://java.sun.com/");
            if (!batch) {
                // Display AWT window => may run with older JVM
                final Frame f = new Frame("System Configuration Error");
                f.add(new Label("Java version 1.4 or later is required to run this program."), BorderLayout.NORTH);
                f.add(new Label("Please download it from http://java.sun.com/"), BorderLayout.SOUTH);
                f.pack();
                f.setVisible(true);
                f.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        synchronized (f) {
                            f.notifyAll();
                        }
                    }
                });
                synchronized (f) {
                    try {
                        f.wait();
                    } catch (InterruptedException e1) {
                    }
                }
            }
            System.exit(1);
View Full Code Here

Examples of java.awt.Frame

  // ----------------------------------------------------------

  private void drawAWTImage(OutputStream outStr, int iThumbWidth, int iThumbHeight, float fQuality) throws IOException, InstantiationException, InterruptedException {

    String sInputURI;
    Frame awtFrame;
    JPEGImageEncoder encoder;
    JPEGEncodeParam param;
    BufferedImage thumbImage;
    Graphics2D graphics2D;
    URL oURI;

    if (DebugFile.trace) {
      DebugFile.writeln("Begin Image.drawAWTImage([OutputStream], " + String.valueOf(iThumbWidth) + "," + String.valueOf(iThumbHeight) + "," + String.valueOf(fQuality));
      DebugFile.incIdent();
    }

    sInputURI = getString(DB.path_image);

    if (sInputURI.startsWith("http://") || sInputURI.startsWith("https://")) {
      oURI = new URL(sInputURI);

      if (DebugFile.trace) DebugFile.writeln("java.awt.Toolkit.getDefaultToolkit().getImage([java.net.URL])");

      oImg = Toolkit.getDefaultToolkit().getImage(oURI);
    }
    else {
      if (DebugFile.trace) DebugFile.writeln("java.awt.Toolkit.getDefaultToolkit().getImage(sInputURI)");

      oImg = Toolkit.getDefaultToolkit().getImage(sInputURI);
    }

    int iImageWidth = oImg.getWidth(null);
    int iImageHeight = oImg.getHeight(null);

    double thumbRatio = ((double) iThumbWidth) / ((double) iThumbHeight);
    double imageRatio = ((double) iImageWidth) / ((double) iImageHeight);

    if (thumbRatio < imageRatio)
      iImageHeight = (int)(iThumbWidth / imageRatio);
    else
      iThumbWidth = (int)(iThumbHeight * imageRatio);

    if (null==mediaTracker) {
      if (DebugFile.trace) DebugFile.writeln("new java.awt.;Frame()");

      try {
        awtFrame = new Frame();
      } catch (Exception e) { throw new InstantiationException("Cannot instantiate java.awt.Frame " + (e.getMessage()!=null ? e.getMessage() : "")); }

      if (DebugFile.trace) DebugFile.writeln("new MediaTracker([Frame])");

      mediaTracker = new MediaTracker(awtFrame);
View Full Code Here

Examples of java.awt.Frame

      int iImageHeight = oImg.getHeight(null);

      if (null==mediaTracker) {
        if (DebugFile.trace) DebugFile.writeln("new java.awt.Frame()");

        Frame awtFrame = null;
        try {
          awtFrame = new Frame();
        } catch (Exception e) { throw new InstantiationException("Cannot instantiate java.awt.Frame " + (e.getMessage()!=null ? e.getMessage() : "")); }

        if (DebugFile.trace) DebugFile.writeln("new MediaTracker([Frame])");

        mediaTracker = new MediaTracker(awtFrame);
View Full Code Here

Examples of java.awt.Frame

  }
    }

    public static void main(String [] args) {
  VideoCutPanel vcp;
  Frame frame = new Frame("Test");
  //frame.setSize(512, 512);
  frame.setLayout( new FlowLayout() );
  frame.add(vcp = new VideoCutPanel(args, true));
  frame.setBackground(vcp.getBackground());
  frame.add(vcp = new VideoCutPanel(args, true));
  frame.pack();
  frame.setVisible(true);
    }
View Full Code Here

Examples of java.awt.Frame

            System.out.println( player.getClass().getName() );
        }

        if( player != null ) {
            new StateWaiter(player).blockingRealize();
            Frame f = new Frame();
            f.add( player.getVisualComponent() );
            f.pack();
            f.setVisible(true);
            player.start();
        }
    }
View Full Code Here

Examples of java.awt.Frame

     * Method to attempt a dynamic update for any GUI accessible by this JVM. It
     * will filter through all frames and sub-components of the frames.
     */
    public static void updateAllUIs() {
        CopyPasteContextMenu.newInstance();
        Frame frames[];
        int i1;
        frames = Frame.getFrames();
        i1 = 0;

        for (int i = 0; i < frames.length; i++) {
View Full Code Here

Examples of java.awt.Frame

  {
    System.loadLibrary("jdshow");
   
    final long hwnd;
    {
            Frame f = new Frame("hello");

            //f.setSize(300,400);
            JWindow w = new JWindow(f);

            w.setBackground(new Color(0,0,0,255));
View Full Code Here

Examples of java.awt.Frame

   *
   * @return  <TT>Frame</TT> or <TT>null</TT> if none found.
   */
  protected Frame getParentFrame(ActionEvent evt)
  {
    Frame parent = null;
    if (evt != null)
    {
      final Object src = evt.getSource();
      if (src instanceof Component)
      {
View Full Code Here

Examples of java.awt.Frame

            }
          });
      }
     
      private void handleAction(Runnable runnable) {
        Frame activeFrame = null;
        for (Frame frame : Frame.getFrames()) {
          if (frame.isActive()) {
            activeFrame = frame;
            break;
          }
        }
        if (defaultFrame != null) {
          // Move default frame to center to display dialogs at center
          defaultFrame.setLocationRelativeTo(null);
        }
       
        runnable.run();
       
        // Activate previous frame again
        if (activeFrame != null) {
          activeFrame.toFront();
        }
        if (defaultFrame != null) {
          // Move default frame out of user view
          defaultFrame.setLocation(-10, 0);
        }
View Full Code Here

Examples of java.awt.Frame

        char[] cbuf  = new char[1];
        cbuf[0] = (char) ch;
        mp.append(new String(cbuf));
        ch = st.read();
      }
      final Frame top  = new Frame("Show URL");
      top.addWindowListener(
        new WindowAdapter() {

          public void windowClosing(WindowEvent windowEvent) {
            top.dispose();
          }
        });

      top.add(mp);
      top.pack();
      top.setVisible(true);

    } catch (java.io.IOException e) {
    }
  }
View Full Code Here
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.