473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

How to open any window application with specified size(window) using Java?

4
I am using Java to open a window application. i need to open it in a specified size. Please let me know how to do this...Thanks in advance...

- Vatz
Mar 12 '09 #1
8 4236
r035198x
13,262 8TB
Which class did you use for the Window? A JFrame? The API specs will contain the methods.
Mar 12 '09 #2
vatz
4
Thanks for your reply.
I am not using JFrame. And i am not developing the application. As part of my work, i just need to open any window application, for eg: windows media player with a predefined size, which i need to specify while opening. Hope you are able to get me.

- vatz
Mar 12 '09 #3
r035198x
13,262 8TB
How are you opening the application from Java? Runtime.exec? I suppose it would depend on the application being opened. Whether it allows you to pass window size arguments when launching or whether it allows window resizing at all.
Mar 12 '09 #4
vatz
4
Yes. I am using Runtime.exec. Assuming that my application allows to accept window size arguments, could you please tell me how to do that?
Thanks.
Mar 12 '09 #5
JosAH
11,448 Expert 8TB
@vatz
If you can start that other application in the same JVM, i.e. call the main() method of the other's application main class you can get the frame from the Frame class (read the API documentation) and set its size.

kind regards,

Jos
Mar 12 '09 #6
r035198x
13,262 8TB
The exact syntax for the arguments would be documented in the application's manual itself. You do know how to call Runtime.exec with a command and arguments right?
Mar 12 '09 #7
vatz
4
Thanks to both of you.
i do know how to call with a command, but i do not know how to use the arguments. please help.

- Vatz
Mar 12 '09 #8
JosAH
11,448 Expert 8TB
@vatz
If you take the approach I outlined in my previous reply, you simply do this:

Expand|Select|Wrap|Line Numbers
  1. public class YourClass {
  2.    public static void main(String[] myArgs) {
  3.       final String[] theirArgs= myArgs;
  4.       try {
  5.          SwingUtilities.invokeAndWait(new Runnable() {
  6.             public void run() { OtherApplication.main(theirArgs);
  7.          });
  8.          thread.sleep(SOME_TIME); 
  9.       } catch { e.printStackTrace(); }
  10.       Frame[] frames= Frame.getFrames();
  11.       // play with the frames array ...
  12.    }
  13. }
  14.  
kind regards,

Jos
Mar 12 '09 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ben | last post by:
Hi there, in a form, here's what I want to do : <input type=button onclick= (???) is it possible to open a pop-up window with a specified url without using javascript ? Thanks
1
by: Matt | last post by:
My problem is when the user click the submit button, it will launch another new window for the request page. I want to confirm we cannot use JavaScript open window functions to open a request page?...
1
by: timw07 | last post by:
I am looking for some code that will create a list of all open window's titles... for example if you have Outlook, IE and IRC open the list or array of strings will contain Outlook, IE, IRC... I...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
3
by: MLH | last post by:
I seem to remember a post in the distant past discussing how to switch to another open application window. IE, if WordPad is running, some API function that'll allow me to switch the focus to that...
0
by: lauren quantrell | last post by:
I have an Access 2000 application and I am using ShowWindow to hide the MS Access application window. Works fine as long as there is a popup form open all the time. The problem is when I want to...
1
by: Doug | last post by:
When opening a DOC file via a hyperlink, is it possible to force Microsoft Word to open in a specified-size window? For example, a 600x300 window? I realize that MS Word will 'remember' the...
1
by: peerraghu | last post by:
hi i am creating travels project using .net and c# and iam new to java scripts i want to open new window with in the same page after clicking the image i have wreiten code just look at this ...
1
mageswar005
by: mageswar005 | last post by:
Hello, In My Application i have open the PDF file from javascript open.window function.In This scenario i want to control / Hide the PDF Toolbar from open.window function. My Current code is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.