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

JScrollPane and JTextArea don't mix when there is a RowHeader

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs



      Name: sg39081 Date: 11/02/99


      Confirmed in Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-M)
      sheri.good@eng

      Bring up the example and type serveral lines of text in the text
      areas. As soon as the text area starts to scroll, the RowHeader
      component gets written over.

      Move the scrollbar and it continues to be corrupted. Resizing
      will get it back to normal

      ------------------
      import javax.swing.*;
      import java.awt.event.*;
      import java.awt.*;

      public class SunTest18 extends JFrame {

      public SunTest18() {
      super("JScrollPane bug");

      JTextArea textArea = new JTextArea(40,80);

      SPanel panel = new SPanel();
      panel.setPreferredSize(new Dimension(30,30));

      JScrollPane pane = new JScrollPane(textArea);

      pane.setRowHeaderView(panel);

      getContentPane().add(pane);
      addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
      System.exit(0);
      }
      });
      }
      public static void main(String[] args) {
      SunTest18 s = new SunTest18();
      s.pack();
      s.setSize(300,200);
      s.show();
      }
      public class SPanel extends JPanel {
      public void paintComponent(Graphics g) {
      g.drawLine(getWidth()/2,0,getWidth()/2,getHeight() -1);
      }
      }
      }
      (Review ID: 96437)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: