JBrowser Source Code Files

JBrowser Source Code Files are provided in the source package file.

You can download JBrowser source package as described in the previous tutorial and go to the "src" sub-folder to view Source Code files.

You can also browse JBrowser Source Code files below:

✍: FYIcenter

org/mozilla/browser/impl/components/JFakeTooltip.java

package org.mozilla.browser.impl.components;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.Point;

import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.Border;


public class JFakeTooltip extends JDialog {

    private static final long serialVersionUID = -5265135238377781454L;

    private JLabel tooltipLabel;

    public JFakeTooltip() {
    	init();
	}

    public void init() {
        setDefaultLookAndFeelDecorated(false);
        setUndecorated(true);
        setFocusable(false);
        setFocusableWindowState(false);
        //alwaysonTop paints tooltip also
        //above other windows
        //setAlwaysOnTop(true);

        JPanel box = new JPanel();
        Border border = UIManager.getBorder("ToolTip.border"); //$NON-NLS-1$
        box.setBorder(border);
        box.setLayout(new BorderLayout());

        tooltipLabel = new JLabel(""); //$NON-NLS-1$
        tooltipLabel.setHorizontalAlignment(SwingConstants.CENTER);

        Color fg = UIManager.getColor("ToolTip.foreground"); //$NON-NLS-1$
        Color bg = UIManager.getColor("ToolTip.background"); //$NON-NLS-1$
        Font f = UIManager.getFont("ToolTip.font"); //$NON-NLS-1$
        tooltipLabel.setOpaque(true);
        tooltipLabel.setForeground(fg);
        tooltipLabel.setBackground(bg);
        tooltipLabel.setFont(f);
        //add space at the sides
        Border b = BorderFactory.createEmptyBorder(0,3,0,3);
        tooltipLabel.setBorder(b);
        box.add(tooltipLabel, BorderLayout.CENTER);

        setContentPane(box);
    }

    public void setup(int x, int y, String aText)
    {
        tooltipLabel.setText(aText);

        //start with coordinates relative to mozilla canvas
        Point loc = new Point(x,y);
        //relocate coordinates relative to parent window
        SwingUtilities.convertPointToScreen(loc, getParent());
        //add size of the cursor
        loc.translate(15, 15);
        setLocation(loc);

        pack();
    }

    public JLabel getTooltipLabel() {
        return tooltipLabel;
    }

}

org/mozilla/browser/impl/components/JFakeTooltip.java

Or download all of them as a single archive file:

File name: jbrowser-1.9-fyi.zip
File size: 625318 bytes
Release date: 2022-11-10
Download 

 

Downloading JBrowser 1.9

Download and Install JBrowser Source Package

Download and Review JBrowser

⇑⇑ FAQ for JBrowser

2017-07-17, ≈25🔥, 1💬