Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4820080

RFE: Cannot Change the JSplitPane Divider Color while dragging

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.1
    • client-libs
    • tiger
    • x86
    • windows_nt



      Name: jk109818 Date: 02/18/2003


      FULL PRODUCT VERSION :
      j2sdk1.4.1_01

      FULL OPERATING SYSTEM VERSION :Win NT 4.0


      A DESCRIPTION OF THE PROBLEM :
      I want to change the color of the JSplitPane divider. I
      opened the code and found that, the color is hard coded to
      darkGray while one is dragging the splitDivider. I have an
      application where the components on SplitPane have black
      background, So when i drag I can not see the split getting
      dragged. Can some one fix this, by externelising the
      SplitDivider color so that it can be changed at run time.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      ****** The code snippet of BasicSpiltPaneUI *******

          /**
           * Returns the default non continuous layout divider, which is an
           * instanceof Canvas that fills the background in dark gray.
           */
          protected Component createDefaultNonContinuousLayoutDivider() {
              return new Canvas() {
                  public void paint(Graphics g) {
                      if(!isContinuousLayout() && getLastDragLocation() != -1) {
                          Dimension size = splitPane.getSize();

                          g.setColor(Color.darkGray);
                          if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
                              g.fillRect(0, 0, dividerSize - 1, size.height - 1);
                          } else {
                              g.fillRect(0, 0, size.width - 1, dividerSize - 1);
                          }
                      }
                  }
              };
          }
      ---------- END SOURCE ----------
      (Review ID: 181300)
      ======================================================================

            apikalev Andrey Pikalev
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: