Tomasz Mularczyk
Tomasz Mularczyk

Reputation: 36199

BallonTip Java, how to move the balloon

I'm using BalloonTip component in my program and I couldn't find the answer how to move it (to the right).

PoleTekstowe = new javax.swing.JTextField();

Balonik = new BalloonTip(PoleTekstowe, "Nie dzielimy przez 0!");
Balonik.setVisible(false);
Balonik.setCloseButton(BalloonTip.getDefaultCloseButton(), false);    

Too bad I cant post an image yet.

Upvotes: 1

Views: 1721

Answers (1)

MadProgrammer
MadProgrammer

Reputation: 347314

You could use something like...

BalloonTip tip = new BalloonTip(
                field, 
                new JLabel("Type Something"),
                new RoundedBalloonStyle(5,5,Color.WHITE, Color.BLACK), 
                BalloonTip.Orientation.RIGHT_BELOW, 
                BalloonTip.AttachLocation.ALIGNED, 
                15, 
                15, 
                true);

Which is demonstrated in the Tweaking a balloon tip's position section of the manual...

enter image description here

I'd also grab a copy of the source code, as it makes it eaiser to see how they build the tooltips...

Upvotes: 1

Related Questions