Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Java applet force to use 2nd monitor and be maximized

Hi,
right now I have the following setup:
I login to windows 10 and a java applet starts minimized on the first monitor which is defined as monitor 1. 2nd monitor is mirrored to another monitor, let's call it monitor 3.

What I want is this: user logs into windows and the java applet runs maximized on the 2nd monitor.

I tried to move it by myself and place it on the 2nd monitor and have it manually resized. After that I tried to stop the java applet and restart it but the java applet starts minimized again on monitor 1.

I prefer a solution without installing a third party program. User account do have admin rights, so windows settings can be touched and edited.

For a usable solution I'll offer you a free beer or a steam game which is equal to 5-10€

Comments

  • @dev_vps cause you are a windows specialist

  • davidedavide Member
    edited September 2024

    AutoHotKey.

    Thanked by 1gbzret4d
  • gbzret4dgbzret4d Member
    edited September 2024

    @davide said:
    AutoHotKey.

    I thought already about AHK but it need to be installed, that's why I'm asking if there is an easy solution which can be done with windows itself

  • @gbzret4d

    One option is to use powershell script that will launch the Java applet and move it to the second monitor programmatically.

    Start-Process "path\to\your\java\applet.exe"
    Start-Sleep -Seconds 5  # Give the app time to open
    $app = (Get-Process | Where-Object {$_.MainWindowTitle -like "*part_of_applet_title*"})
    if ($app) {
        [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
        $appWindow = New-Object -TypeName System.Windows.Forms.Form
        $appWindow.StartPosition = "Manual"
        $appWindow.Left = 1920  # Set this to the pixel width of your first monitor
        $appWindow.Top = 0
        $appWindow.Width = 1920  # Set the width of the second monitor
        $appWindow.Height = 1080 # Set the height of the second monitor
    }
    
    Thanked by 1gbzret4d
  • gbzret4dgbzret4d Member
    edited September 2024

    @dev_vps said:
    @gbzret4d

    One option is to use powershell script that will launch the Java applet and move it to the second monitor programmatically.

    Start-Process "path\to\your\java\applet.exe"
    Start-Sleep -Seconds 5  # Give the app time to open
    $app = (Get-Process | Where-Object {$_.MainWindowTitle -like "*part_of_applet_title*"})
    if ($app) {
        [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
        $appWindow = New-Object -TypeName System.Windows.Forms.Form
        $appWindow.StartPosition = "Manual"
        $appWindow.Left = 1920  # Set this to the pixel width of your first monitor
        $appWindow.Top = 0
        $appWindow.Width = 1920  # Set the width of the second monitor
        $appWindow.Height = 1080 # Set the height of the second monitor
    }
    

    Java applet is already auto starting. If possible, I would like to have to make as few settings as possible, as this PC is also used by people who are not IT-savvy and this is a more critical application. It shows the staff at a larger fire station the vehicles and equipment they need and other information.

    Will try your solution in my Windows vm.

    At the moment I don't know how the Java applet works. I assume that the java applet connects to a command center or receives the data from there, but I still have to check that. I hope its just a shortcut in windows autostart, so your option would be a good solution.

    I will collect more ideas and solution approaches

Sign In or Register to comment.