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

RFE: Cannot Change the JSplitPane Divider Color while dragging

    XMLWordPrintable

Details

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

    Description



      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)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: