JDK-4395089 : Merlin: Buttons added in JToolBar has default JButton margin, not (0,0,0,0)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2000-12-05
  • Updated: 2001-02-28
  • Resolved: 2001-02-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Relates :  
Description
	ddd
----------------------------

A similar bug was reported - #4264764, fix has been integrated
into Merlin-beta build, but problem still exist in Merlin build 43.

J2SE Version (please include all output from java -version flag):

java version "1.4.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b42)
Java HotSpot(TM) Client VM (build B42, mixed mode)


Does this problem occur on J2SE 1.3?  Yes / No (pick one)

No

Operating System Configuration Information (be specific):

Win2000

Bug Description:

Under Merline b42 buttons added to JToolbar have default JButton's margin
(looks badly), under JDK1.3 have margin (0,0,0,0)

Test program:
==============
/*
 * ButtonMargin.java
 *
 * Created on 12/5/2000, 16:48
 */


/**
 * There is difference in margin settings when adding buttons to toolbar
 * JDK1.3 - Insets(0,0,0,0) - good
 * Merlin b42 Insets(?,?,?,?) - bug
 *
 * @author  ###@###.###
 */
public class ButtonMargin extends javax.swing.JFrame {

    /** Creates new form ButtonMargin */
    public ButtonMargin() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        jToolBar1 = new javax.swing.JToolBar();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        }
        );
        
        
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("Plus.gif")));
        jToolBar1.add(jButton1);
        
        
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("Minus.gif")));
        jToolBar1.add(jButton2);
        
        
        getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
        
        
        jPanel1.setLayout(null);
        jPanel1.setPreferredSize(new java.awt.Dimension(200, 100));
        
        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("Plus.gif")));
        jPanel1.add(jButton3);
        jButton3.setLocation(10, 10);
        jButton3.setSize(jButton3.getPreferredSize());
        
        
        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("Plus.gif")));
        jPanel1.add(jButton4);
        jButton4.setLocation(10, 10);
        jButton4.setSize(jButton4.getPreferredSize());
        
        
        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("Minus.gif")));
        jPanel1.add(jButton5);
        jButton5.setLocation(80, 10);
        jButton5.setSize(jButton5.getPreferredSize());
        
        
        getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
        
        pack();
    }//GEN-END:initComponents

    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
        System.exit(0);
    }//GEN-LAST:event_exitForm

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        new ButtonMargin().show();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    // End of variables declaration//GEN-END:variables

}




Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

EVALUATION This regression was introduced between b29 (8/18) and b30 (8/31) as a result to the fix for 4247996 and 4260484 to BasicToolBarUI. I agree that this should be fixed. The smaller buttons with Insets(0,0,0,0) in the toolbar should be restored. I think we need a ruling from an HIE in order to stop this tug of war. mark.davidson@Eng 2001-01-12 HIE has determined that the buttons in a toolbar will have a different margin. The inner padding around the button image shall be 3,3,3,3. I've added back the methods createNonRolloverBorder and createRolloverBorder to install these borders depending on context. mark.davidson@Eng 2001-02-16
16-02-2001