harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Zakharov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-2332) [classlib][swing] JList provide wrong tooltip when mouse is over free space
Date Wed, 14 Mar 2007 14:34:10 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-2332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexei Zakharov updated HARMONY-2332:
-------------------------------------

    Priority: Minor  (was: Major)

> [classlib][swing] JList provide wrong tooltip when mouse is over free space
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-2332
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2332
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Denis Kishenko
>            Priority: Minor
>         Attachments: HARMONY-2332-actual.PNG, HARMONY-2332-expected.PNG
>
>
> JList tooltipping should be:
> - when mouse is over the particular cell region (fine visible when cell is
> selected) then tooltip from its renderer should be tried first
> - when mouse over the free space, not covered by any cell then list tooltip
> should be the preferred one.
> Currently the tooltip from the nearest cell is used. 
> In JList.getToolTipText(MouseEvent) cell identification with locationToIndex()
> should be complemented with getCellBounds() call to determine if mouse is
> really over the cell.
> ========= Test ==============
> import java.awt.Component;
> import javax.swing.JFrame;
> import javax.swing.JLabel;
> import javax.swing.JList;
> import javax.swing.ListCellRenderer;
> public class Test {
>     
>     static class MyRenderer extends JLabel implements ListCellRenderer {
>         public Component getListCellRendererComponent(JList list, Object value, int index,
boolean isSelected, boolean cellHasFocus)
>         {
>             setText(value.toString());
>             setToolTipText(value.toString());
>             return this;
>         }
>     }
>     
>     public static void main(String[] args) {
>         JFrame f = new JFrame();
>         JList l = new JList(new Object[] {"red", "yellow", "green", "blue"});       

>         l.setToolTipText("this is tooltip");
>         l.setCellRenderer(new MyRenderer());          
>         f.getContentPane().add(l);        
>         f.setSize(150, 150);
>         f.setVisible(true);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message