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

JScrollPane problem when the LF is set to Motif

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • merlin
    • x86
    • windows_nt



      Name: skT88420 Date: 10/15/99


      Output for java -version:
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      Output for java -fullversion:
      java full version "JDK-1.2.2-W"


      When the look and feel is changed to Motif during program
      execution, the background color of the JScrollPane scrollbars
      isn't set to the Motif background color. The program below
      demonstrates this:

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

      public class A extends JFrame
      {
         public A()
         {
            super();
            
            final JPanel p = new JPanel();
                 

            final JScrollPane sp = new JScrollPane(p,
                                                   ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                                                   ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS );
            setContentPane(sp);
                 
            final JButton btn = new JButton("Change to Motif LF");
            
            p.add(btn);
                 
            btn.addActionListener(new ActionListener()
            {
               public void actionPerformed(ActionEvent ev)
               {
                  try
                  {
                     UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                     SwingUtilities.updateComponentTreeUI(sp);
                     btn.setEnabled(false);
                  }
                  catch(Exception ex)
                  {
                     ex.printStackTrace();
                  }
               }
            });
         }
         
         public static void main(String args[] )
         {
            A a = new A();
                  
            a.setSize(400, 400);
            a.setVisible(true);
         }
      }
      (Review ID: 96635)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: