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

JSpinner shows unmotivated black line in the text area

    Details

    • OS:
      windows_8

      Description

      FULL PRODUCT VERSION :
      java 1.6.0_39 and java 1.7.0_13

      ADDITIONAL OS VERSION INFORMATION :
      windows 8 6.2

      A DESCRIPTION OF THE PROBLEM :
      When a JSpinner is changed by mouse click it shows an unmotivated ugly black line inside the upper part of the text area

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      start the added application an click into the spinner to increase its values.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Proper painting inside a spinner, no unmotivated dirty regions
      ACTUAL -
      Not proper painting with unmotivated black line at the top of the spinners text area

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.classwizard.cw;


      import java.awt.BorderLayout;
      import java.awt.Container;
      import java.awt.Dimension;
      import java.awt.GridBagConstraints;
      import java.awt.GridBagLayout;
      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;
      import java.io.File;

      import javax.swing.Box;
      import javax.swing.JDesktopPane;
      import javax.swing.JDialog;
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JSpinner;
      import javax.swing.SpinnerNumberModel;
      import javax.swing.WindowConstants;


      public class ClassWizard extends Object
      {
          public static void main(String args[]) throws Exception
          {
              try
              {
                  DialogTest ket = new DialogTest();
                  GJApp.launch(ket, " ButtonTest " ,0,0,700,700,null);
              }
              catch (Exception e)
              {
                  System.out.println(e.getMessage());
                  e.printStackTrace();
              }
          }
      }
      class GJApp extends WindowAdapter
      {
          public static void launch(final DialogTest f, String title,final int x, final int y,final int w, int h,String propertiesFilename)
          {
              f.setTitle(title);
              f.setBounds(x,y,w,h);
              f.setVisible(true);
              f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
              f.addWindowListener(new WindowAdapter()
              {
                  public void windowClosed(WindowEvent e)
                  {
                      System.exit(0);
                  }
              });
          }
      }

      class DialogTest extends JFrame
      {
          protected JDesktopPane desktopPane = new JDesktopPane();
          SpinnerDialog _buttondlg = null;
          
          protected File outfile = null;
          boolean _even = true;
          int _flickercount = 0;
          javax.swing.Timer _timer = null;

          
          public DialogTest() throws Exception
          {
              String osname = System.getProperty( " os.name " );
              String osversion = System.getProperty( " os.version " );
              String java_version = System.getProperty( " java.version " );
              System.out.println(osname + " " + osversion + " java: " + java_version + "
       " );
              
              // make a dialog with a drag button
              _buttondlg = new SpinnerDialog(this, " spinner " , false);
              _buttondlg.init();
              _buttondlg.setVisible(true);
              _buttondlg.setLocation(300, 100);

          }
      }

      class SpinnerDialog extends JDialog
      {
          SpinnerDialog _dlg = null;
          DialogTest _owner = null;
          JSpinner oneSpinner = null;
          
          public SpinnerDialog(DialogTest owner, String title, boolean modal)
          {
              super(owner,title,modal);
              _owner = owner;
              _dlg = this;
          }

          public JPanel makeButtonsPanel()
          {
              GridBagLayout gbl = new GridBagLayout();
              GridBagConstraints gbc = new GridBagConstraints();
              oneSpinner = new JSpinner(new SpinnerNumberModel(1,1,100,1));

              JPanel paraPanel = new JPanel();
              paraPanel.setLayout(gbl);
              paraPanel.setPreferredSize(new Dimension(150, 150));

              paraPanel.add(Box.createHorizontalStrut(10));
              gbc.gridwidth = GridBagConstraints.REMAINDER;
              paraPanel.add(oneSpinner, gbc);
              
              
              return(paraPanel);
          }
          public void init()
          {
              JPanel paraPanel2 = makeButtonsPanel();
              Container diacontent = this.getContentPane();
              diacontent.add(paraPanel2, BorderLayout.NORTH);
              setPreferredSize(new Dimension(280, 150));
              setResizable(true);
              pack();
          }
      }
          

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aivanov Alexey Ivanov
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: