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

Focus not painted in JButton with no border in motif LAF

    Details

    • Subcomponent:
    • CPU:
      generic, x86
    • OS:
      generic, windows_nt

      Description

      Name: dk106046 Date: 09/01/2003

      In motif look and feel, when a JButton's border is not painted(button.setBorderPainted(false);),
      its focus is also not painted. The saqme does not happen with a jcheckbox ot a jradiobutton.

      Expected Result
      Even if the border of a JButton is not painted, its focus should be painted.

      Test suite:
      1. SwingSet2 demo program
      2. Below is a crude program to illustrate this defect.

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

      class test extends JFrame{
             public test() throws Exception{
                    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                    this.getContentPane().setLayout(new FlowLayout());
                    JButton button=new JButton("Test");
                    JButton button1=new JButton("Test1");
                    this.getContentPane().add(button);
                    this.getContentPane().add(button1);
                    button.setBorderPainted(false);
                    this.setSize(100,100);
             }

             public static void main(String[] args){
                    try{
                    test test1=new test();
                    test1.show();
                    }catch(Exception e){}
             }
      }

      Steps to Recreate:
      1. Run the above program.
      or
      2. Run SwingSet2 demo. Change Look and feel to motif.
      Select Button demo. Deselect 'Paint border' and select 'Paint focus' .
      Click on the buttons and observe that the focus is not painted.

      [This bug is being submitted as a courtesy, in order to maintain uniformity between Sun & IBM JDKs. It has been fixed in IBM JDKs.
      Please contact ###@###.### if you have questions.]
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shickeysunw Shannon Hickey (Inactive)
                Reporter:
                dkorbel David Korbel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: