Tooltip « Component « Java Swing Q&A





1. How do I control the display of a JComponent's Tooltip?    stackoverflow.com

I have a JComponent that's painting various shapes on itself. I'm detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly. The problems I'm having are:

  • The tooltip ...

2. Can Swing tell me if there is an active tooltip?    stackoverflow.com

Is there an elegantish way in Swing to find out if there are any tooltips currently being displayed in my frame? I'm using custom tooltips, so it would be very easy to ...

3. Changing "Favorites" Tooltip in Java Help    stackoverflow.com

In my helpset file, I'm declaring a favorites view, using

<view>
  <name>Lesezeichen</name>
  <label>Lesezeichen</label>
  <type>javax.help.FavoritesView</type>
  <data></data>
</view>
This automatically adds an appropriate button to the toolbar (in the swing application). Unfortunately, ...

4. Multi-line tooltips in Java?    stackoverflow.com

I'm trying to display tooltips in Java which may or may not be paragraph-length. How can I word-wrap long tooltips?

5. Is there a way to set the delay time of tooltips being displayed on a particular component in java swing?    stackoverflow.com

I'm trying to set tooltips on a JEditorPane. The problem is that the method which I use to determine what tooltip text to show is fairly CPU intensive - and so ...

6. Java tool tip not displaying    stackoverflow.com

The program I am writing has a Swing GUI and several of the components have Tooltips. These are all on JButton, JCheckBox and JRadioButton components, they are set using the setToolTipText ...

7. Continuous Tooltip Update in Swing    stackoverflow.com

I have a custom swing component that is implemented similar to a JTree. It has a ComponentUI that renders an object list using a CellRenderer. The tooltip now correctly shows for ...

8. Why getToolTipText is never called?    stackoverflow.com

I have got a JComponent. The paintComponent Mehtod is overridden. I mentioned that tooltips were not occuring reliable. Sometimes they were displayed and sometime they didn't. Now I dont't see tooltips ...

9. ToolTip on second monitor is displayed at the edge of the monitor    stackoverflow.com

I have got a component. The ToolTip of the component is set by the setToolTipText() method. On the first monitor everything works fine. Now when I move the frame to the ...





10. Library for eclipse style tooltips?    stackoverflow.com

Does anyone know of an open source swing tooltip library that works like eclipse's tooltips? Specifically, the functionality I'm looking for is a tooltip that acts like a regular tooltip, but ...

11. Change TrayIcon Tooltip from ProgressMonitorDialog    stackoverflow.com

I am using the Eclipse RCP trayitem, which is described in Vogellas tutorials. The requirement now is not only to show the name of the app in the tooltip but ...

12. Swing: show accelerator in tooltip    stackoverflow.com

How do I make a tooltip of a toolbar button (which is based on the same Action as a menu item) show the accelerator at the right?

13. How can I draw my own ToolTip in place of the default for Swing components?    stackoverflow.com

I'm attempting to create my own custom ToolTip for a program I've ported to Java, I'm trying to match the original programs ToolTips (it was written in Delphi). I've got some ...

14. Detect a toolTip launch java    stackoverflow.com

Hey, is there any way to detect the launch of a tool tip on a swing component in Java? Cant even think where to start on this one. cheers

15. Setting tool tip text for a graphic object    stackoverflow.com

Is there a way to set tool tip text for a drawn line ? I have looked at stackoverflowques and tried its answer but its not working. In my program I ...

16. Java3D stuttering issue with Swing tooltips    stackoverflow.com

A Java project I am working on is having a bizarre conflict between Java3d and Swing tooltips. Our program is setup with a Java3D Canvas3D in the center surrounded by Swing JComponents ...





17. Java Swing: How to be notified if tool tip is about to become visible?    stackoverflow.com

I have a lot of components that set tool tips with JComponent.setToolTipText(...). However, these tool tips change often based on many events. I could make a setToolTipText(...) call each ...

18. How to use new line character within a ToolTip    stackoverflow.com

Possible Duplicate:
Multi-line tooltips in Java?
It is very strange. All I wish to do is make my tool tip multi-lined. I have added ...

19. How to display a temporary baloon tooltip during input validation?    stackoverflow.com

I'm somewhat used to the GUI idiom where when I type something wrong in a text input field a balloon pops up from the field with info about what I got ...

20. Swing shows empty tooltips, how to disable this?    stackoverflow.com

I'm creating a java Swing app and I'm new to that. The problem is that when I move cursor to menu item, for example, it shows me an empty tooltip. Is there any ...

21. [platform-dev] Tooltips causing GUI to freeze in Windows    forums.netbeans.org

Nicklas L Posted via mailing list. Posted: Thu Jan 13, 2011 5:12 am Post subject: [platform-dev] Tooltips causing GUI to freeze in Windows Hello list. I have been trying to find the cause of a very strange bug in one of my Netbeans RCP applications. It was reported by a windows user that said the application was freezing ...

22. To have multi line tooltip text    coderanch.com

I need to have a multiline tooltip text...this is to represent the address of a person as the tool tip when the mouse is moved on to it.In general we will have tool tip text of single line and that extends tooo long for the complete address.so i need multiple line tooltip text.

23. Hidden Tool Tips    coderanch.com

24. Tooltip Text in awt components    coderanch.com

26. Menmonics and ToolTips    coderanch.com

27. Multiline Tooltip    coderanch.com

I checked out the link and saw it was useful. The best way, however, is to use good old html. Much less code and more flexible to edit. String text = "Name: Brian
Home: The street"; comp.setToolTipText(text); The only extra is that you will need a component renderer to do it sucessfully. class TreeRenderer extends JLabel implements TreeCellRenderer { CategoryPermission ...

28. How to change Tooltip renderer?    coderanch.com

Hi I want to implement 'microhelp' in my app. - ie have a line of help at the foot of the frame window with the help in it. Someone suggested I could do this if I - ".. change the tool tip renderer to display in the status line ..." - how do I change the tooltip renderer? Marc

29. ToolTip not appearing    coderanch.com

Okay, now the problem is I have a button, which has a imagepanel inside it & then to place the button's text, I'm adding labels to the imagepanel by setting its layout. Now, the imagepanel does'nt have the settootip property , so I tried setting this to the labels, but they're getting hidden behind the imagepanel. What could be the problem ...

30. Implementing multi-line tooltip    coderanch.com

31. Performance such as ToolTip    coderanch.com

Hello Coders! I need to perform an action such as ToolTip. Ive tried to set such an algorithm, which allows me to do line warping among the input text, but I find it very complicated. I wonder if there is another form that I can provide such a performance, maybe by extending ToolTip? In my case I use a text field ...

32. Fire the ToolTip in different way    coderanch.com

HI Coders I've extended Jpanel and I draw an Image inside it so that Jpanel is the viewport of the image. In usual circumstances when i mouse over the image's viewport the ToolTip execute ,but in my case I need to execute the ToolTipText without actually mouse over the image's viewport, instead I need to press a button which in turn ...

33. tooltips    coderanch.com

34. Making tooltip stay for a while.    coderanch.com

35. JPopup That Looks Like ToolTip    coderanch.com

36. Tooltip problems - no ComponentUI class    coderanch.com

37. How do I force popup of tooltip?    coderanch.com

I'm looking for a way to force a tooltip to display itself. Unfortunatly, I can't find anything in the API, or anything at many of the java-examples websites. I know how to modify the duration of the TT display and how to make it show instantaniously, but I don't know how to get it to sow a TT on component X ...

38. Help on Tooltip    coderanch.com

Hello I am trying to write an application with tooltip feature on some of the components. Now by default the tooltip comes up when there is a mouse over on the component. I want to change this aspect and get the tooltip on a mouse pressed event on the component. In fact when the user keeps the mouse pressed for a ...

39. Tool Tip problem    coderanch.com

Hi I am using ToolTipManager to show the tool tip on differnet components. I have used setInitialDelay() and setReshowDelay() methods to ensure tool tip is visble only after a fixed delay. The code is working fine except for the case that say two buttons are close to each other.Now when mouse eneters button 1 ..tool tip is shown after the initial ...

40. location of tool tip text    coderanch.com

41. Help on making the tool tip to multiple lines.    coderanch.com

I thought an html tag would work, but when I add
to my tooltip text, it just displays
with the rest of the text (all on one line). I'm probably doing something obviously wrong, but what is it?import javax.swing.JFrame ; import javax.swing.JButton ; import java.awt.FlowLayout ; public class FooFrame extends JFrame { private void constructGUI() { JButton button = ...

42. tool tip help!!    coderanch.com

43. Timing on ToolTips    coderanch.com

44. Formatting tooltips    coderanch.com

// This table displays a tool tip text based on the string // representation of the cell value JTable table = new JTable() { public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) { Component c = super.prepareRenderer(renderer, rowIndex, vColIndex); if (c instanceof JComponent) { JComponent jc = (JComponent)c; jc.setToolTipText((String)getValueAt(rowIndex, vColIndex)); } return c; } };

45. Tooltip for table header    coderanch.com

46. ToolTip location issue    coderanch.com

Hi, I have an app the runs on a pc with 2 monitors. The main frame has a JDesktopPane and splits across 2 monitors. in the desktop pane i got internal frame that has a table. If the table is on monitor 1, then locaton of tooltip is Ok. If the table is on monitor 2, then tool tip will alway ...

47. Moveable tooltips    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; public class MovableTip { public static void main(String[] args) { JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(new MovableTipPanel(f)); f.setSize(400,400); f.setLocation(200,200); f.setVisible(true); } } class MovableTipPanel extends JPanel { JWindow mobileTip; JLabel label; public MovableTipPanel(JFrame f) { mobileTip = new JWindow(f); label = new JLabel(); label.setHorizontalAlignment(JLabel.CENTER); mobileTip.getContentPane().add(label); mobileTip.setSize(125,20); setBackground(Color.white); TipMover tipMover = new TipMover(this); ...

48. How to set next line in ToolTip    coderanch.com

49. Multiline Tooltip    coderanch.com

hi, i couldn't understand your problem. but below code is for displaying header comment (Comment at the starting of the file) as tooltip. /** Creates new form CommentAsToolTip */ import java.io.*; import javax.swing.*; import javax.swing.event.*; public class CommentAsToolTip extends javax.swing.JFrame { JButton jButton1; /** Creates new form CommentAsToolTip */ public CommentAsToolTip() { initComponents(); setTip(); } public void setTip() { String str="No ...

50. Display tooltip in oval shape    coderanch.com

51. toolTips lost when saving to a file    coderanch.com

52. ColumnLabelProvider SWT tooltip problem    coderanch.com

53. tooltip    coderanch.com

54. tooltip    coderanch.com

55. Tooltips    coderanch.com

The code is part of a game that is about 4000 lines and I've been working on it for over a year. class planet extends spaceObj { private String Empire; private int Population;//manpower private int mpGain;//monthly increase in manpower private int Industry;//total number of industrial units on planet private int freeIC;//industrial units not busy at moment private int Citycomplete;//time in days ...

56. Tooltips lost when saving object    coderanch.com

I am writing a program that needs to save information periodically (ie a forced user backup). The object being saved has a JCheckBox on which I called setToolTipText. The problem is when the object is saved the tool tip text is lost. However if I quit the program and read in the save file the tool tip text is restored. I ...

57. Make a tool tip appear programmatically    coderanch.com

After skimming the web and the forums,I can't seem to find a good way to accomplish this. I'm using InputVerifiers to check text box inputs, and when the input is not valid, I would like the tool tip for that text box to appear. Is there a way to do this? Thanks again, Chris

58. Problem in Tooltip    coderanch.com

The mouseMoved method needs to check for whether 1) the mouse enters the rectangle (so that the tooltip should be displayed), and 2) the mouse leaves the rectangle (so that the tooltip should no longer be displayed). These two events should set/unset a boolean field, so that the paintComponents method can draw or not draw the tooltip based on that. How ...

59. Setting dynamic tooltips for a vector    coderanch.com

Hey, I'm trying to dynamically set tooltips on the titles of the columns in a table, but whenever i try to do this it gives me the following code errors. Here is the code: private void initColumns() { columns = new Vector(); DataDictionaryModel[] ddm = cam.getDDModel(); this.ddm = ddm; for (int i = 0; i < ddm.length; i++) { columns.add(ddm[i].getDisplayName()); String ...

60. To set tool tip only for the leaf nodes    coderanch.com

Hi all I use a JTee where the elements are loaded dynamically. I want to set the tool tip only for the leaf elements. But it is setting to the entire tree. public Component getTreeCellRendererComponent(JTree tree,Object value, boolean sel, boolean expanded,boolean leaf, int row, boolean hasFocus) { Component component = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); this.setForeground(Color.black); this.setBackground(new Color(107,194,206)); this.backgroundNonSelectionColor ...

61. Glasspanes and tooltips    coderanch.com

Hi all, I'm having a problem with components' tooltips not being rendered correctly when those components are on a glass pane. What I want to accomplish is this: I have a JFrame, full of different components. (A huge GUI really.) On top of this, I want to put a glass pane with a transparent black background. On the glass pane, I ...

62. Tooltip on Line2D or Rectangle2D    coderanch.com

Thanks for the replies, sorry if the question is silly, this is my first encounter with a desktop application, I've worked on web applications till now. I tried what you said, the contains method always returns false for Line2D, so I used the static Line2D.ptLineDist to find the distance of the pointer to the line, I used the mouse motion listener ...

63. ToolTip text is not being updated    coderanch.com

Hi fellow ranchers, I've stumbled across yet another small annoyance, this time when using ToolTips. Say you have a JTable with ToolTipText enabled for a specific column. The text for the ToolTip for that column is the same, say "Click for combobox". When hoovering over first row in that column the tool tip appears correctly, but when moving the mouse cursor ...

64. word wrapping tooltips    coderanch.com

65. toolTip is displaying empty.    coderanch.com

I developed my application using netbeans. I tried to add tooltip for drawing. If i directly run the applet class (from netbeans) the tooltip is clearly showing the data. If i embed it in the html and run (Even from the IDE) the tooltip is showing nothing but a white. You its so. Am i making any mistake. //panel for displaying ...

66. Shortening default time of tool tip visibility    coderanch.com

Hi all - Can someone please elaborate on the proper usage of ToolTipManager's initialDelay, reshowDelay and dismissDelay? The API is not very informative in my opinion, and I can't seem to find any decent examples how to manipulate these to get what I want. Basically all I want to do is make the tool tip invisible immediately when the cursor leaves ...

67. (SWT/JFace)Questions about pop-up tooltip in treeviewer    coderanch.com

I want to implement the following functionality in a treeviewer. 1. When user select a tree item, I want that a small frame like a toolbar can be pop-up and user can click button inside to switch to differenct editors or viewers. 2. When mouse move to a tree item, I want that a tooltip window is pop-up which should be ...

68. Setting Tool Tip    coderanch.com

Hello, I am trying to create a tool tip which will be displayed on painted text using graphics. I am stuck because i do not know how to proceed. i have achieved this so far: @Override protected void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; List strings = Arrays.asList("Show Me", "One", "Two"); int x = 5; for (String each : ...

69. Tooltip is causing popups to go behind the main screen, how can I fix this?    java-forums.org

Hello, I'm facing a tooltip issue at work which I can't seem to reproduce in my stand-alone codes. Basically, I have a panel that contains a table with headlines. When I move the mouse through the headlines, if any popup or window is open on the main application, the tooltip causes it to go behind the app. The tooltip is implemented ...

70. Tooltips; More or less Swing related    java-forums.org

Greetings, Suppose I have an infix expression, more exact: I have the abstract syntax tree of the expression. I have complete control over this AST and can 'visit' every node of it. It is easy to reconstruct the textual representation of such an expression. (or the postfix form or whatever). I can even 'pretty print' it using a Graphics2D object, using ...

71. Display multiple tooltips at once    java-forums.org

Hi, Is there is a way to display multiple tooltips at once? The desired behaviour is that when a user hovers over a certain element, it will display the tooltips for several related components at once (at appropriate locations). The user can also hover over each individual component and see the tooltip (as is normal). Thanks for any feedback!

72. manually trigger tooltips    java-forums.org

73. Problem to ToolTip in Java 3d    java-forums.org

74. How to create ToolTip in Java 3d    java-forums.org

75. Java TrayIcon and Tooltip    forums.oracle.com

Hi everybody ! Im now using TrayIcon . The tooltip message display two caption and the image belong to Message Type as bellow. -Title :String -Message :String. -MessageType:INFO,WARNING,ERROR,NONE. I now want to dis play the tooltip message with two caption and the Icon image that i specify the path as bellow: -Title :String -Message :String. -IconImage : IconImage or path of ...