Results 1 to 7 of 7
  1. #1
    rogerbacon is offline Member
    Join Date
    Jul 2010
    Posts
    3
    Rep Power
    0

    Default Tooltip problem with two monitors

    When I mouse over a control and a tooltip pops up the tooltip is always in monitor one, even if the application is in monitor 2. The tool tip will display all the way on the edge of the screen in monitor 1. How can I get the tooltip to show up right next to where the mouse is?

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    monitor A and B what you mean?
    Is your tooltip always in a corner or something?

    Describe your problem in more details please :)

  3. #3
    rogerbacon is offline Member
    Join Date
    Jul 2010
    Posts
    3
    Rep Power
    0

    Default

    When the application is on monitor A then the tooltip appears where it should (next to the cursor). When the application is on monitor B then the tooltip appears at the same vertical position as the cursor but on monitor A and all the way to the edge of the screen (like it's trying to be in the right position but it can't quite get out of monitor A).

  4. #4
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    what component the tooltip is added?
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  5. #5
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Probably best to show us how you set up the component the tooltip is for, and probably its parent as well. (read as "code please, worth more than a picture (and thats worth a thousand words)")
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    Maybe the OP supplies his/her own tooltip JComponent and something's wrong there. The default tooltip component is just a JTooltip and that one should work ... b.t.w. don't believe that "a picture is worth a thousand words" crap; thousand words take +- 8KB at most while a picture takes +- 1MB on average ;-)

    kind regards,

    Jos

  7. #7
    rogerbacon is offline Member
    Join Date
    Jul 2010
    Posts
    3
    Rep Power
    0

    Default

    I'm taking over a project that someone else wrote so I'm not too familiar with the code yet but this tooltip thing was bothering me and I thought it might be a simple fix. Also, I am new to java so I don't know too much about it. Here is the code that sets up the tooltip
    Java Code:
    // -----------------------------------------
    		// set up the button bar
    	
    		editButton = new javax.swing.JButton();
    		deleteButton = new javax.swing.JButton();
    		groupsButton = new javax.swing.JButton();
    	
    		buttonPanel_ = new javax.swing.JPanel();
    		buttonPanel_.setMinimumSize(new java.awt.Dimension(300, 38));
    		buttonPanel_.setLayout(new FlowLayout(FlowLayout.LEFT));
    		Color hdrcolor = HeaderPanel.HDRPANE_BGCOLOR.getColor();
    		buttonPanel_.setBackground(new Color(hdrcolor.getRed(), hdrcolor.getGreen(), hdrcolor.getBlue(), 50));
    		buttonPanel_.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, java.awt.Color.GRAY));
    	
    		addButton = new javax.swing.JButton();
    		addButton.setOpaque(false);
    		addButton.setText("Add Program Item...");
    		addButton.setToolTipText("Add a new program item.");
    		addButton.addActionListener(new java.awt.event.ActionListener() {
    		  public void actionPerformed(java.awt.event.ActionEvent evt) {
    			addButtonActionPerformed(evt);
    		  }
    		});
    	
    		buttonPanel_.add(addButton);
    	
    		groupsButton.setText("Add Group...");
    		groupsButton.setOpaque(false);
    		groupsButton.setToolTipText("Edit group list.");
    		groupsButton.addActionListener(new java.awt.event.ActionListener() {
    		  public void actionPerformed(java.awt.event.ActionEvent evt) {
    			addGroupButtonActionPerformed(evt);
    		  }
    		});
    	
    		buttonPanel_.add(groupsButton);
    	
    		editButton.setText("Edit...");
    		editButton.setOpaque(false);
    		editButton.setToolTipText("Edit the selected program item.");
    		editButton.addActionListener(new java.awt.event.ActionListener() {
    		  public void actionPerformed(java.awt.event.ActionEvent evt) {
    			editButtonActionPerformed(evt);
    		  }
    		});
    	
    		buttonPanel_.add(editButton);
    	
    		deleteButton.setText("Delete");
    		deleteButton.setOpaque(false);
    		deleteButton.setToolTipText("Delete the selected program item.");
    		deleteButton.addActionListener(new java.awt.event.ActionListener() {
    		  public void actionPerformed(java.awt.event.ActionEvent evt) {
    			deleteButtonActionPerformed(evt);
    		  }
    		});
    	
    		buttonPanel_.add(deleteButton);
    		
    		getComponent().add(jPanel2, java.awt.BorderLayout.CENTER);
    		
    	    // need to handle attachments differently
    	    addSelectionListener();
    	    getComponent().invalidate();
    	    
    		myTableCellRenderer_ = new InnerTreeTableCellRenderer();			
    		myTreeRenderer_ = new InnerTreeCellRenderer();			
    		myTableBodyRenderer_ = new InnerTableBodyCellRenderer();		
    	}	
      }

Similar Threads

  1. Tooltip
    By rohinideepthi in forum Java Applets
    Replies: 0
    Last Post: 09-26-2009, 08:29 AM
  2. tooltip
    By suman in forum New To Java
    Replies: 2
    Last Post: 07-31-2008, 01:57 PM
  3. Tooltip
    By Preethi in forum New To Java
    Replies: 5
    Last Post: 06-11-2008, 11:37 AM
  4. Problem to ToolTip in Java 3d
    By roshithmca in forum AWT / Swing
    Replies: 1
    Last Post: 02-05-2008, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •