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

Button.setBounds(x,y,w,h) hides button when x or y is too small

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description



      Name: kaC94536 Date: 01/31/2000



         Code below should show a frame with part of the green button visible
      inside. But, unfortunately, there is no button in the window.
         The same behavior observed when other components (Label, Panel) are
      used instead of button.
      ---------------------------- test.java -------------------------------
      import java.awt.*;

      class test {
         
         static int x = -100000;
         
         public static void main(String args[]) {
            Frame f = new Frame();
            f.setSize(300, 300);

            Button b = new Button("test");
            b.setBackground(Color.green);
            f.add(b);
            f.getLayout().removeLayoutComponent(b); // exclude LayoutManager influence

            b.setBounds(x, 30, 270-x, 240);

            f.show();
         }
      }
      ======================================================================

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            mbronsonsunw Mike Bronson (Inactive)
            Reporter:
            kanisimosunw Konstantin Anisimov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: