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

Dirty painting in MenuItem (black lines)

XMLWordPrintable

    • windows_8

      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 :
      If a menu is opened and the menu items are entered by the mouse cursor and then exited by the mouse cursor black lines are remaining looking like separators

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      start the added Application and open the menu " test " and move the mouse curser over the menu items. Additionally black lines are shown looking like unwanted separators

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      after exiting a menu item it looks like before entering the menu item
      ACTUAL -
      after exiting a menu item it does not look like before entering the menu item,
      black lines are shown

      REPRODUCIBILITY :
      This bug can be reproduced always.

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


      import java.awt.event.WindowAdapter;
      import java.awt.event.WindowEvent;

      import javax.swing.JDesktopPane;
      import javax.swing.JFrame;
      import javax.swing.JMenu;
      import javax.swing.JMenuBar;
      import javax.swing.JMenuItem;
      import javax.swing.WindowConstants;
      import javax.swing.tree.DefaultTreeModel;


      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();
          DefaultTreeModel _treeModel = 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 menu
              JMenuBar mainMenuBar = new JMenuBar();
              JMenu menu1 = new JMenu( " test " );
              JMenuItem oneMenuItem = new JMenuItem( " menuIem1 " );
              JMenuItem twoMenuItem = new JMenuItem( " menuIem2 " );
              JMenuItem threeMenuItem = new JMenuItem( " menuIem3 " );
              mainMenuBar.add(menu1);
              menu1.add(oneMenuItem);
              menu1.add(twoMenuItem);
              menu1.addSeparator();
              menu1.add(threeMenuItem);
              this.setJMenuBar(mainMenuBar);
          }
      }

         

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

            scfitch Stephen Fitch
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: