Examples of Toolkit

Most applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the ae.java.awt package with their counterparts in ae.java.awt.peer. Some methods defined by Toolkit query the native operating system directly. @author Sami Shaio @author Arthur van Hoff @author Fred Ecks @since JDK1.0

  • charva.awt.Toolkit
    @author vali @author Levente S\u00e1ntha
  • java.awt.Toolkit
    sun.com/docs/books/tutorial/uiswing/misc/focus.html#transferTiming">Timing Focus Transfers, a section in The Swing Tutorial.

  • Making a top-level container visible.
    Calling setVisible(true) on a Window, Frame or Dialog may occur asynchronously.

  • Setting the size or location of a top-level container.
    Calls to setSize, setBounds or setLocation on a Window, Frame or Dialog are forwarded to the underlying window management system and may be ignored or modified. See {@link java.awt.Window} formore information.

    Most applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the java.awt package with their counterparts in java.awt.peer. Some methods defined by Toolkit query the native operating system directly. @version 1.203, 12/19/03 @author Sami Shaio @author Arthur van Hoff @author Fred Ecks @since JDK1.0

  • org.sonar.sslr.toolkit.Toolkit

  • Examples of java.awt.Toolkit

            if (getNeedToRegenerate() || bitmap == null) {

                computePixels();

                Toolkit tk = Toolkit.getDefaultToolkit();
                bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));
            }

            if (imageFilter != null) {
                bitmap = filterImage();
            }
    View Full Code Here

    Examples of java.awt.Toolkit

        contentPane.add(pane);

        setTitle("PDF Test Application");

        // Set the location and size of the window and show it
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension screenSize = toolkit.getScreenSize();
        setLocation(50, 50);
        setSize(w, h/2);
        setVisible(true);
        toFront();
       
    View Full Code Here

    Examples of java.awt.Toolkit

      private void printPdf() {
        System.out.println("Printing..");
        JobAttributes jobAttributes = new JobAttributes();
        //jobAttributes.setDialog(JobAttributes.DialogType.NONE);
        // CRAP!! - This doesn't work with jdk1.2.2 - fix it
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        PrintJob pjob = toolkit.getPrintJob(this,
                                            "PDF Test Print",
                                            jobAttributes, 
                                            null);
        if(pjob != null) { 
          Graphics printGraphics = pjob.getGraphics();
    View Full Code Here

    Examples of java.awt.Toolkit

       * @param g a <code>Graphics</code> value
       * @param d a <code>Dimension</code> value
       */
      private void drawSampleImage(Graphics g, Dimension d) {
        try {
          Toolkit toolkit = Toolkit.getDefaultToolkit();
          Image img = toolkit.createImage(sampleImageFile);
          MediaTracker tracker = new MediaTracker(drawingArea);
          tracker.addImage(img, 0);
          try {
            tracker.waitForID(0);
          }
    View Full Code Here

    Examples of java.awt.Toolkit

        getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);

        pack();

        Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
        java.awt.Dimension screenSize = toolkit.getScreenSize();
        int screenResolution = toolkit.getScreenResolution();
        float zoom = ((float) screenResolution) / JRViewer.REPORT_RESOLUTION;

        int height = (int) (550 * zoom);
        if (height > screenSize.getHeight())
        {
    View Full Code Here

    Examples of java.awt.Toolkit

        getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);

        pack();
       
        Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
        java.awt.Dimension screenSize = toolkit.getScreenSize();
        int screenResolution = toolkit.getScreenResolution();
        float zoom = ((float) screenResolution) / JRViewer.REPORT_RESOLUTION;
       
        int height = (int) (550 * zoom);
        if (height > screenSize.getHeight())
        {
    View Full Code Here

    Examples of java.awt.Toolkit

          URL url = loader.getResource(name);
          if (url == null) {
            url = loader.getResource("/" + name);
          }
          if (url != null) {
            Toolkit tk = Toolkit.getDefaultToolkit();
            Image img = tk.getImage(url);
            return img;
          }
        }

        return null;
    View Full Code Here

    Examples of java.awt.Toolkit

                        imStyles = hl.getStyle();
                    } catch (NoSuchMethodError e) {
                    }
                   
                    if (imStyles == null) {
                        Toolkit tk = Toolkit.getDefaultToolkit();
                        imStyles = tk.mapInputMethodHighlight(hl);
                    }

                    if (imStyles != null) {
                        HashMap newStyles = new HashMap(5, (float)0.9);
                        newStyles.putAll(oldStyles);
    View Full Code Here

    Examples of java.awt.Toolkit

        }

        public static Image loadImage ( String strFileName ) {
            Image           image = null;
            URL           url;
            Toolkit           toolkit;
            Class           classObject;
            Object                 objImageProducer;
            ImageProducer         imageProducer;
            BufferedInputStream    streamImage;
            byte                   arrImageBytes [];

            toolkit = Toolkit.getDefaultToolkit ();

            try {
                classObject = Class.forName ( "jamp.MainWindow" );
                url = classObject.getResource ( strFileName );
                if ( url != null ) {
                    objImageProducer = url.getContent ();
                    if ( objImageProducer instanceof ImageProducer ) {
                        imageProducer = (ImageProducer) objImageProducer;
                        image = toolkit.createImage ( imageProducer );
                    }
                    else if ( objImageProducer instanceof BufferedInputStream ) {
                        streamImage = (BufferedInputStream) objImageProducer;
                        arrImageBytes = new byte [streamImage.available()];
                        streamImage.read ( arrImageBytes );
                        image = toolkit.createImage ( arrImageBytes );
                    }
                }
            }
            catch ( Exception exception ) {
                exception.printStackTrace ();
    View Full Code Here

    Examples of java.awt.Toolkit

    *  to help with finding the source code for the component being highlighted.
    */
    public class DebugEventListener implements AWTEventListener
    {
      public void setEnabled(boolean enable) {
        Toolkit kit = Toolkit.getDefaultToolkit();
        if (enable) {
          /* register as a listener for mouse events */
          kit.addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK|AWTEvent.MOUSE_MOTION_EVENT_MASK);
         
          /* show all tooltips for ten seconds before hiding */
          ToolTipManager.sharedInstance().setDismissDelay(10000);     
        } else {
          kit.removeAWTEventListener(this);
        }
      }
    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.