Package javax.swing

Examples of javax.swing.JToolTip


    return getPreferredSize(c);
  }

  public void paint(Graphics g, JComponent c) {
    Font font = c.getFont();
    JToolTip mtt = (JToolTip) c;
    FontMetrics fontMetrics = mtt.getFontMetrics(font);
    Dimension dimension = c.getSize();
    int fontHeight = fontMetrics.getHeight();
    int fontAscent = fontMetrics.getAscent();
    String tipText = ((JToolTip) c).getTipText();
    if (tipText == null)
View Full Code Here


          return super.getToolTipLocation(event);
      }

      public JToolTip createToolTip() {
        if (getToolTipText().startsWith("<html>")) {
          JToolTip tip = new HyperLinkToolTip();
          tip.setComponent(this);
          return tip;
        } else {
          return super.createToolTip();
        }
      }};
View Full Code Here

          return super.getToolTipLocation(event);
      }

      public JToolTip createToolTip() {
        if (getToolTipText().startsWith("<html>")) {
          JToolTip tip = new HyperLinkToolTip();
          tip.setComponent(this);
          return tip;
        } else {
          return super.createToolTip();
        }
      }
View Full Code Here

          return super.getToolTipLocation(event);
      }

      public JToolTip createToolTip() {
        if (getToolTipText().startsWith("<html>")) {
          JToolTip tip = new HyperLinkToolTip();
          tip.setComponent(this);
          return tip;
        } else {
          return super.createToolTip();
        }
      }
View Full Code Here

    public Point getToolTipLocation(MouseEvent event) { // the tip MUST be touching the button if html because you can click on links
      return new Point(getWidth()-2, -20);
    }

    public JToolTip createToolTip() {
        JToolTip tip = new HyperLinkToolTip();
        tip.setComponent(this);
        return tip;
    }
View Full Code Here

      return super.getToolTipLocation(event);
  }

  public JToolTip createToolTip() {
    if (getToolTipText().startsWith("<html>")) {
      JToolTip tip = new HyperLinkToolTip();
      tip.setComponent(this);
      return tip;
    } else {
      return super.createToolTip();
    }
  }
View Full Code Here

   * @param w Width of the area to paint to
   * @param h Height of the area to paint to
   */
  public void paintToolTipBackground( SynthContext context, Graphics g, int x, int y, int w, int h )
  {
    JToolTip toolTip = ( JToolTip ) context.getComponent();
    JPanel panel = ( JPanel ) toolTip.getParent();
    if ( !opaqueTips.contains( toolTip ) ) {
      toolTip.setOpaque( false );
      panel.setOpaque( false );
      panel.repaint();
      toolTip.repaint();
      opaqueTips.add( toolTip );
    }
    String imagePath = ( String ) UIManager.get( "ToolTip.background" );
    Insets sInsets = new Insets( 7, 7, 7, 7 );
    Insets dInsets = new Insets( 7, 7, 7, 7 );
View Full Code Here

            }
        }

        @Override
        public Point getToolTipLocation(MouseEvent event) {
            JToolTip tip = createToolTip();
            tip.setTipText(getToolTipText());
            Dimension tipSize = tip.getPreferredSize();
            if (tipSize == null || tipSize.width == 0 || tipSize.height == 0) {
                return new Point(1, -24);
            }
            int x = (getWidth() - tipSize.width) / 2;
            int y = -tipSize.height - 2;
View Full Code Here

    {
      Point preferredLocation = component.getToolTipLocation(event);
      Rectangle sBounds = component.getGraphicsConfiguration().
      getBounds();

      JToolTip tip = component.createToolTip();
      tip.setTipText(toolTipText);
      Dimension size = tip.getPreferredSize();
      Point location = new Point();

      Point screenLocation = component.getLocationOnScreen();
      if(preferredLocation != null)
      {
View Full Code Here

   *
   * @return The tool tip.
   */
  @Override
  public JToolTip createToolTip() {
    JToolTip tip = super.createToolTip();
    Color textAreaBG = textArea.getBackground();
    if (textAreaBG!=null && !Color.white.equals(textAreaBG)) {
      Color bg = TipUtil.getToolTipBackground();
      // If current L&F's tool tip color is close enough to "yellow",
      // and we're not using the default text background of white, use
      // the editor background as the tool tip background.
      if (bg.getRed()>=240 && bg.getGreen()>=240 && bg.getBlue()>=200) {
        tip.setBackground(textAreaBG);
      }
    }
    return tip;
  }
View Full Code Here

TOP

Related Classes of javax.swing.JToolTip

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.