B4J Question [SOLVED] Windows screen resolution

Discussion in 'B4J Questions' started by jroriz, Aug 26, 2019.

  1. jroriz

    jroriz Active Member Licensed User

    When I change the resolution of my display, using windows config, all open windows (non B4J) automatically adjust their sizes according to the new resolution, except my form created in b4j. I need the form I created also changes its size proportionally to the chosen resolution.
    I thought this would happen automatically, no code required.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Are you changing the resolution or the scale (DPI)? Why would the windows change their sizes when you change the resolution?
     
    amykonio likes this.
  3. jroriz

    jroriz Active Member Licensed User

    You're right.
    I bought a 4k monitor, and what is happening is that when I switch to higher resolutions, windows is changing the DPI.
    But all windows change their scales, except the forms created in B4J.
    I'll try some compatibility modes...
     
    Last edited: Aug 27, 2019
  4. Erel

    Erel Administrator Staff Member Licensed User

    Try it with Java 11. It might work better.
     
  5. Daestrum

    Daestrum Well-Known Member Licensed User

    You could try
    Code:
    #VirtualMachineArgs: -Dsun.java2d.dpiaware=true
    in the project attributes region.

    Also something else to look at, if I drag a window to my second screen, it stays roughly the same size even though one res is 1600x900, and the other is 3840x2160. The reason - windows added a % scale to the second screen (in display settings). Setting the scale back to 100% for the second screen makes the window shrink as it crosses the screen division.
     
    Last edited: Aug 28, 2019
    Anser and DonManfred like this.
  6. jroriz

    jroriz Active Member Licensed User

    You're right.
    The scale was at 200% ...
    I changed it to 100% and everything is right now.
    Just in case, I also used the @Daestrum suggestion.
    Thank you all.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice