Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-04-11 00:49:18

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Java progam size

Sorry if this is off topic ... but you guys are all so smart smile

I've got a java application not really written for this platform. However, the magical incantation "java -jar theapplication.jar" brings up the window and lets it run, etc. Wonderful.

However, the window, is so damned small I can hardly read anything! And the resize corners are disabled. So, how to I increase the size?

The only thing I can think of is creating a separate login using a smaller screen size ... but that seems a silly thing to be doing in 2020 smile

Offline

#2 2020-04-11 01:17:03

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: Java progam size

Are you using a HiDPI screen?

There are some options for scaling java windows here.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2020-04-11 01:43:28

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Java progam size

I'm not sure if my screen is or isn't HiDPI. It's 1920x1080.

Interesting link. Thanks ... I'm only able to use integer sizes like 2 or 200% and that makes the window just a little bit too big.

Offline

#4 2020-04-11 01:58:08

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: Java progam size

No, that's not a Hi DPI screen - just a regular one.

Which parameters did you try? If the app an AWT/Swing or JavaFX app? If it's a swing app, do these settings help?

Also, what version of Java are you running?

java -version

Last edited by ToZ (2020-04-11 02:04:29)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2020-04-11 02:22:30

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Java progam size

More questions ... how do I tell if it is AWT/Swing or JavaFX?

My java (from the distro) is

bob$ java --version
openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu119.10.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu119.10.1, mixed mode, sharing)

So, I guess it's openjdk. Not sure if I can get a better version or not?

I did try both:

java -Dsun.java2d.uiScale=2 -jar some_swing_application.jar
java -Dsun.java2d.uiScale=300% -jar some_swing_application.jar

and both work to double the size ... and that gives spillage off the bottom of the screen. And using factors like 1.5 or 150% just round out to 2. Just like it says smile

The javaFX options have no effect.

Thanks.

Offline

#6 2020-04-11 02:31:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: Java progam size

Mellowbob wrote:

More questions ... how do I tell if it is AWT/Swing or JavaFX?

Based on the commands that worked for you, its a swing app.

So, I guess it's openjdk. Not sure if I can get a better version or not?

Version is fine - UI scaling only got added at around version 9.

I did try both:

java -Dsun.java2d.uiScale=2 -jar some_swing_application.jar
java -Dsun.java2d.uiScale=300% -jar some_swing_application.jar

and both work to double the size ... and that gives spillage off the bottom of the screen. And using factors like 1.5 or 150% just round out to 2. Just like it says smile

The javaFX options have no effect.

Thanks.

Does the following work any better?

java -Dsun.java2d.win.uiScaleX=125% -Dsun.java2d.win.uiScaleY=125% -jar some_swing_application.jar

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2020-04-11 03:15:59

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Java progam size

ToZ wrote:

Does the following work any better?

java -Dsun.java2d.win.uiScaleX=125% -Dsun.java2d.win.uiScaleY=125% -jar some_swing_application.jar

Unfortunately, no. Has no effect at all. Does run, but the same as without the commands.

Offline

#8 2020-04-11 12:25:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,006

Re: Java progam size

That is the extent of my knowledge on getting java apps to scale. It looks like the app itself is unable to scale to a more fine tuned value.

I did come across this script which uses xpra to run an app in scaled mode. Unfortunately, the xpra package was dropped from the ubuntu repositories after 19.04. So you might have some difficulty finding it.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2020-04-15 18:39:17

Mellowbob
Member
Registered: 2011-10-16
Posts: 286

Re: Java progam size

Thanks for the help. Guess I'm stuck with moving the window up/down with ALT-Left-Mouse.

I did think I'd be real clever and adjust the DPI setting for Fonts, but that just effects fonts sizes. Oh well, interesting game trying to get this stuff to work!

Best,

Offline

Board footer

Powered by FluxBB