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

Graphics coordinate overflow with sizes larger than Short.MAX_VALUE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 1.1, 1.1.6, 1.2.0
    • client-libs
    • x86, sparc
    • solaris_2.5.1, windows_95



      Name: rk38400 Date: 05/14/98


      In Windows 95, when using a file larger than 300k, the background color of the JTextArea becomes gray and the screen
      will get painted with various false images randomly(when clicked with the mouse or selected for cut and paste).
      The next repaint will paint correctly the screen, but the screen gets messed up again using mouse clicks and drags.
      This same code behaves correctly with any size file in NT. The following is a sample code:

      Reader rdr = null;
      File f = new File("x.txt");
      try {
       rdr = new FileReader(f);
      } catch (Exception e){
      }

      try{
       DefaultEditorKit ek = new DefaultEditorKit();

       JTextArea textArea = new JTextArea();
       textArea.setBorder(new EmptyBorder(0,0,0,0));
       if (rdr != null){
          ek.read(rdr, textArea.getDocument(), 0);
       }

       JScrollPane scroller = new JScrollPane() {
         public float getAlignmentX() {
           return LEFT_ALIGNMENT;
         }
       };
       scroller.getViewport().add(textArea);
       textArea.setFont(new Font("Courier", Font.PLAIN, 12));
       textArea.setEditable(false);
       add(scroller, BorderLayout.CENTER);
          
      } catch (Exception ex) {
      }
      (Review ID: 27511)
      ======================================================================

      An easy way to reproduce this is to load /etc/termcap into the Swing
      Notepad example and scroll down to the bottom.
      timothy.prinzing@eng 1998-10-21

            son Oleg Sukhodolsky (Inactive)
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: