From Alexander.Potochkin at Sun.COM Fri Mar 14 05:25:23 2008 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Fri, 14 Mar 2008 15:25:23 +0300 Subject: [TEST CASE] 6219960 NullPointer on ToolTipManager.mouseEntered In-Reply-To: References: Message-ID: <47DA6EB3.2080509@sun.com> Hello Jason Your test case is really helpful, thank you very much I reopened this bug and upgraded its priority Thanks again alexp > Bug 6219960 has marked Closed, will not be fixed because the evaluator > could not create a test case. Attached is a test case that will produce > the null pointer without using custom components (JDK6u4). Hopefully > this is enough proof that this is a real bug. > > Jason Mehrens > > ------------------------------------------------------------------------ > Climb to the top of the charts! Play the word scramble challenge with > star power. Play now! > > > > ------------------------------------------------------------------------ > > import java.awt.*; > import javax.swing.*; > import javax.swing.table.*; > > public class SinglePixelTooltip implements Runnable { > > static volatile Robot robot; > > static JFrame frame; > static JButton save; > static JTable table; > > public static void main(String[] args) throws Exception { > robot = new Robot(); > SwingUtilities.invokeAndWait(new SinglePixelTooltip()); > robot.waitForIdle(); > Thread.sleep(5L * 1000L); > showModal("The tooltip should be showing. Press ok with mouse. And don't move it."); > showModal("Now press ok and move the mouse inside the table (don't leave it)."); > > Thread.sleep(5L * 1000L); > showModal("Notice the error happens on mouse move.\n"+ > "Press ok and move the mouse over the "+ > "button to stop the errors.\n"+ > "When the tooltip is shown the 1x1 pixel is gone."); > } > > > public void run() { > ToolTipManager.sharedInstance().setDismissDelay(10 * 60 * 1000); > frame = new JFrame(); > frame.setLocation(20, 20); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > JDesktopPane desk = new JDesktopPane(); > JInternalFrame iframe = new JInternalFrame(); > iframe.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE); > desk.add(iframe); > save = new JButton(); > save.setToolTipText("Wait for dialog to show."); > save.setText("Wait for the tooltip to show."); > JPanel panel = new JPanel(new GridLayout(1, 2)); > panel.add(save); > table = createTable(); > panel.add(new JScrollPane(table)); > iframe.setContentPane(panel); > frame.getContentPane().add(desk); > frame.setSize(800, 600); > iframe.setSize(640, 480); > iframe.validate(); > iframe.setVisible(true); > frame.validate(); > frame.setVisible(true); > try { > iframe.setSelected(true); > } > catch(Exception E) { > throw new AssertionError(E); > } > > Point pt = frame.getLocation(); > robot.mouseMove(pt.x + 100, pt.y + 100); > } > > private static void showModal(final String msg) throws Exception { > SwingUtilities.invokeAndWait(new Runnable() { > public void run() { > JOptionPane.showInternalMessageDialog(table, msg, > Thread.currentThread().toString(), > JOptionPane.PLAIN_MESSAGE); > } > }); > } > > private static JTable createTable() { > DefaultTableModel model = new DefaultTableModel(); > JTable table = new JTable(model); > table.setFillsViewportHeight(true); > return table; > } > } From rohe.daniel at gmail.com Tue Mar 18 13:19:47 2008 From: rohe.daniel at gmail.com (Daniel Rohe) Date: Tue, 18 Mar 2008 15:19:47 -0500 Subject: 4923525: Replace getDefaultPattern(Locale) with DateFormat in JSpinner Message-ID: <4185a8440803181319o7b7c8e78w8683f38f8597c425@mail.gmail.com> Hello, as I can see the bug 4923525 is fixed in the database but the code still remains there and is not replaced by using static methods of DateFormat as suggested in the bug description. I think this fix is fast and doesn't change any expected behavior. So I made a small patch to the JSpinner's DateEditor class. The format used when creating a date is a short date and time. Does someone has any concerns regarding the change? Regards, Daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080318/92014c52/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: 4923525_JSpinner.diff Type: application/octet-stream Size: 1345 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080318/92014c52/attachment.obj From jason_mehrens at hotmail.com Wed Mar 19 14:52:19 2008 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Wed, 19 Mar 2008 16:52:19 -0500 Subject: [PATCH] 6219960 NullPointer on ToolTipManager.mouseEntered Message-ID: This patch hides the previous tooltip if the component already exists on mouse entry. Added default constructors to inner classes to avoid synthetic accessors. Jason _________________________________________________________________ Don't get caught with egg on your face. Play chicktionary! http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_feb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080319/501eacfd/attachment.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ToolTipManager.diff Url: http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080319/501eacfd/attachment.ksh From jason_mehrens at hotmail.com Fri Mar 21 11:22:56 2008 From: jason_mehrens at hotmail.com (Jason Mehrens) Date: Fri, 21 Mar 2008 13:22:56 -0500 Subject: [PATCH] 6219960 NullPointer on ToolTipManager.mouseEntered Message-ID: Reordered some statements for this final patch. Jason _________________________________________________________________ Test your Star IQ http://club.live.com/red_carpet_reveal.aspx?icid=redcarpet_HMTAGMAR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080321/0b3850a4/attachment.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ToolTipManager.diff Url: http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20080321/0b3850a4/attachment.ksh From Alexander.Potochkin at Sun.COM Fri Mar 21 11:28:52 2008 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Fri, 21 Mar 2008 21:28:52 +0300 Subject: [PATCH] 6219960 NullPointer on ToolTipManager.mouseEntered In-Reply-To: References: Message-ID: <47E3FE64.1090405@sun.com> Hello Jason > Reordered some statements for this final patch. Thank you I'll have a look on Monday see you alexp > > Jason > > ------------------------------------------------------------------------ > Test your Star IQ Play now! > > > > ------------------------------------------------------------------------ > > --- c:\temp\ToolTipManager.java 2007-09-04 08:53:36.624566600 -0500 > +++ c:\temp\6219960\ToolTipManager.java 2008-03-20 10:10:53.816257200 -0500 > @@ -411,8 +411,10 @@ > return; > } > > + boolean sameComponent = (insideComponent == component); > if (insideComponent != null) { > enterTimer.stop(); > + hide(insideComponent); > } > // A component in an unactive internal frame is sent two > // mouseEntered events, make sure we don't end up adding > @@ -420,8 +422,6 @@ > component.removeMouseMotionListener(this); > component.addMouseMotionListener(this); > > - boolean sameComponent = (insideComponent == component); > - > insideComponent = component; > if (tipWindow != null){ > mouseEvent = event; > @@ -614,6 +614,7 @@ > } > > protected class insideTimerAction implements ActionListener { > + insideTimerAction() {} > public void actionPerformed(ActionEvent e) { > if(insideComponent != null && insideComponent.isShowing()) { > // Lazy lookup > @@ -638,12 +639,14 @@ > } > > protected class outsideTimerAction implements ActionListener { > + outsideTimerAction() {} > public void actionPerformed(ActionEvent e) { > showImmediately = false; > } > } > > protected class stillInsideTimerAction implements ActionListener { > + stillInsideTimerAction() {} > public void actionPerformed(ActionEvent e) { > hideTipWindow(); > enterTimer.stop(); > @@ -662,6 +665,7 @@ > * solely on mouse-entered to initiate the tooltip. > */ > private class MoveBeforeEnterListener extends MouseMotionAdapter { > + MoveBeforeEnterListener() {} > public void mouseMoved(MouseEvent e) { > initiateToolTip(e); > } > @@ -800,6 +804,7 @@ > * Unpost Tip: Esc and Ctrl+F1 > */ > private class AccessibilityKeyListener extends KeyAdapter { > + AccessibilityKeyListener() {} > public void keyPressed(KeyEvent e) { > if (!e.isConsumed()) { > JComponent source = (JComponent) e.getComponent();