1

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.

Pshemo
  • 122,468
  • 25
  • 185
  • 269
Tomasz Mularczyk
  • 34,501
  • 19
  • 112
  • 166

1 Answers1

1

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...

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • Thanks for help, however I get the message that this type of constructor is undefined. ?? The constructor BalloonTip(JTextField, String, RoundedBalloonStyle, BalloonTip.Orientation, BalloonTip.AttachLocation, int, int, boolean) is undefined – Tomasz Mularczyk Jan 12 '15 at 07:54
  • What version are you using? I downloaded [1.2.4.1](https://java.net/projects/balloontip/downloads) – MadProgrammer Jan 12 '15 at 08:10
  • I also use the latest version – Tomasz Mularczyk Jan 12 '15 at 08:51
  • Well, I used the code above to produce the screen shot. Make sure you've imported all the required classes – MadProgrammer Jan 12 '15 at 09:02
  • Ohhhh, Im sorry, I was writing a String into Second field and it should be JLabel as you post it..... Sorry, and thanks it works! http://imageshack.com/a/img538/1142/zxlBVv.jpg – Tomasz Mularczyk Jan 12 '15 at 09:04