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

REGRESSION: setMargin does not work on JToggleButton in jdk1.4

XMLWordPrintable

    • beta3
    • x86
    • linux



      Name: nt126004 Date: 08/14/2001


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

      1. javac bug.java
      2. java bug
      3. note button size
      4. modify bug line:
            ButtonSource.setMargin(new Insets(0,50,0,50));
       by changing the 50's to another number
      5. javac bug.java
      6. java bug
      7. note button size is unchanged -- bug!

      Here is the source code:

      import java.awt.*;
      import java.awt.event.*;
      import java.util.*;
      import javax.swing.*;
      import javax.swing.event.*;
      import java.io.Serializable;
      import javax.swing.border.*;

      public class t2 extends JFrame
      {
         JPanel tPane = new JPanel();
         t t1 = new t(JToolBar.VERTICAL,this);

         public t2()
         {
            super("PacketStorm Network Emulator");
            Container contentpane = getContentPane();
            tPane.add(t1,BorderLayout.WEST);
            contentpane.add(tPane);
            pack();
         }

         public static void main(String[] args)
         {
            t2 t23 = new t2();

            t23.setBounds(0,0,300,300);
            t23.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
            t23.setVisible(true);
         }

      public class t extends JToolBar
      {
         JToggleButton ButtonSource = new JToggleButton();

         public t( int orient, JFrame packet)
         {
            super(orient);
            add(ButtonSource);
            ButtonSource.setMargin(new Insets(0,50,0,50));
         }
      }
      }
      (Review ID: 129983)
      ======================================================================

            mdavidsosunw Mark Davidson (Inactive)
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: