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

Merlin: Buttons added in JToolBar has default JButton margin, not (0,0,0,0)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta
    • x86
    • windows_2000

      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

      }



            mdavidsosunw Mark Davidson (Inactive)
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: