I would like to use tooltips
like the balloontip library, but I did not find one way to use, it seems to be different from the conventional toolTips
that to be applied use the setToolTipText
method.
How can I apply this balloontip
to a component?
I try to do so:
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JTextField;
import net.java.balloontip.BalloonTip;
public class TesteBalloonTip extends JFrame {
private JTextField jTextField = new JTextField();
public static void main(String[] args) {
EventQueue.invokeLater(()
-> {
TesteBalloonTip tp = new TesteBalloonTip();
tp.setVisible(true);
}
);
}
public TesteBalloonTip() {
BalloonTip ballon = new BalloonTip();
ballon.setAttachedComponent(jTextField);
setSize(500, 300);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
However, when I try to instantiate an object of type ballotip, it gives me error saying:
BalloonTip () has protected access in BalloonTip