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

Mac: setMinSize, setMaxSize doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Environment:

      b30
      macos
      java6

      Description

      To reproduce run following code



      package glass.mat;

      import com.sun.glass.ui.Application;
      import com.sun.glass.ui.Launchable;
      import com.sun.glass.ui.Pen;
      import com.sun.glass.ui.Screen;
      import com.sun.glass.ui.View;
      import com.sun.glass.ui.Window;
      import java.util.Map;

      /**
       *
       * @author javafx
       */
      public class Main implements Launchable{

          public void finishLaunching(String[] strings) {
              createGUI();
          }
          
          public static void main(String[] args) {
              Launchable tl = new Main();
              Application.Run(args, "GUIOrigSizes", tl);
          }
          
          void createGUI() {
              Application app = Application.GetApplication();
              
              int windowMask = Window.TITLED|Window.CLOSABLE|Window.MINIMIZABLE;
              Window w2 = app.createWindow(Screen.getMainScreen(), windowMask);

              w2.setPosition(128, 128);

              if (false) {
                  w2.setMinimumSize(400,400);
                  w2.setSize(312,312);
              } else {
                  w2.setMaximumSize(600,600);
                  w2.setSize(712,712);
              }

              View v2 = app.createView(new MyPen());
              w2.setView(v2);

              w2.setVisible(true);
              System.out.println("w="+w2.getWidth()+" h="+w2.getHeight());
          }
          
          static class MyPen extends Pen
          {
              @Override
              public Map getCapabilities()
              {
                  return addCapability(null, View.Capability.k3dKey, Boolean.FALSE);
              }

              @Override
              public void paint(long timeStamp, int width, int height)
              {
              }
          }
      }

        Attachments

          Activity

            People

            Assignee:
            gziemski Gerard Ziemski
            Reporter:
            anazarov Andrey Nazarov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: