Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:46:47+00:00 2026-06-11T14:46:47+00:00

In Linux, we have virtual screens like desktop 1, 2, 3, 4. Most cases

  • 0

In Linux, we have virtual screens like desktop 1, 2, 3, 4. Most cases we use desktop 1 (screen 1, with one monitor).

Now, my question is how can i tell my java application to launch on desktop 2 (screen 2, with one monitor)

By default when i run java -cp /var/tmp/SystemX.jar run.X it will launch in desktop 1, screen 1. Which is not my case.

Tried: following but did not helped cause, it runs for dual monitor scenario. Not what i am expecting.

 screen = Toolkit.getDefaultToolkit().getScreenSize();
  GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
  GraphicsDevice[] screenDevices = ge.getScreenDevices();
  for (int i = 0; i < screenDevices.length; i++) {
    System.out.println(screenDevices[i].getIDstring());

    int screenWidth = 1024;
    int screenHeight = 764;
    if (screenDevices[i].getDisplayMode()!=null) {
      DisplayMode dm = screenDevices[i].getDisplayMode();
      screenWidth = dm.getWidth();
      screenHeight = dm.getHeight();        
    }
    System.out.println("[myResolution]: " + screenWidth + " " + screenHeight);
    screen.width = screenWidth;
    screen.height = screenHeight;
  }

Follow up:

#!/bin/sh
(export DISPLAY=:0.0 && java -cp /var/tmp/SystemX.jar run.X) & (wmctrl -r "WINDOW_TITLE" -t DESKTOP_NUMBER)

* But what if my application is border less, when it has no window title ? how do i tell wmctrl ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:46:48+00:00Added an answer on June 11, 2026 at 2:46 pm

    The borderless applications should still have window titles. (ie. xfce4-panel shows.) You can check what they are by using:

    wmctrl -l

    From the command line. If you’re having a hard time figuring out which window is yours, try the command before you open it, then once it’s open. That way, you can just look for the new window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts
I would like to limit the amount of physical memory a process can use
We have a few linux based (Centos) virtual machines which are to be used
I'm trying to install virtual-python on linux server which I don't have root access.
I use Linux as primary operating system and I also have to work on
I have a Linux USB HID device (a Hama MCE ), and I can
Linux noob question: If I have 500MB of RAM, and 500MB of swap space,
On linux you can set up a virtual interface using ifconfig eth0:0 .... There's
My question is Linux specific and needs understanding of kernel, virtual memory, mmap, pagefaults.
I am creating new virtual device using ubuntu gelelio@ubuntu:/media/Android/eclipse-linux/android-sdk-linux_x86/tools$ ./android I have create new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.