JDK-6435308 : JTable Resize Cursor not set when using JDialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2006-06-07
  • Updated: 2011-02-16
  • Resolved: 2006-12-06
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
SuSE 10.0

A DESCRIPTION OF THE PROBLEM :
A correctly working JTable that allows column resizing should show a resize cursor when the mouse is in between two columns.

However, this is not the case when the JTable is inside a JDialog.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import javax.swing.table.*;

public class BadCursor {

  public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {
              createJDialog();
              createJFrame();
          }
      });
  }

  public static void createJDialog() {
        // This will create a Dialog with a JTable that does not correctly show
        // a resize cursor.
        JTable table = new JTable(new DefaultTableModel(new String[] {"a", "b"},
            10));
        JFrame parent = new JFrame();
        JDialog dialog = new JDialog(parent, "No Resize Cursor");
        JScrollPane scrollPane = new JScrollPane(table);
        dialog.getContentPane().add(scrollPane);
        dialog.pack();
        dialog.setVisible(true);
  }

  public static void createJFrame() {
        // This will create a Dialog with a JTable that correctly shows
        // a resize cursor.
        JTable table = new JTable(new DefaultTableModel(new String[] {"a", "b"},
            10));
        JFrame frame = new JFrame("Resize Cursor");
        JScrollPane scrollPane = new JScrollPane(table);
        frame.getContentPane().add(scrollPane);
        frame.pack();
        frame.setVisible(true);
  }
}

---------- END SOURCE ----------

Comments
EVALUATION Testing on 5.0u10, I've determined that the resize cursor doesn't show over the table header when used in JDialog. This is a duplicate of 5079694.
06-12-2006

EVALUATION Unfortunately, I'm not exactly sure what the bug is. Sent the following to the submitter for clarification: --- When I launch your test case, and place the mouse between the table headers, I do get a resize cursor. Are you saying that you don't? Or are you asking to be able to resize by placing the mouse anywhere between the columns? Or are you commenting on the fact that if you start resizing and drag off the column headers, the resize cursor dissapears? ---
13-06-2006