Results 1 to 5 of 5
  1. #1
    Y. Progammer is offline Member
    Join Date
    Feb 2010
    Posts
    68
    Rep Power
    0

    Default Passing screen resolution parameters at the launch time of the application!

    1. I made an application and want the application to set itself maximized at the launch time..

    2. Also i want the application to receive the screen resolutions as x and y .. so that it can adjust ...... i mean i made a graph plotter and want the application to set its origin coordinates as per the center of the screen normal or widescreen .. for which i want to pass the resolution at the launch time and every time the user restores the application to default size.

    plz suggest!:)

  2. #2
    sky
    sky is offline Member
    Join Date
    Nov 2009
    Posts
    96
    Rep Power
    0

    Default

    If I have understood correctly what you mean I think that you could just pass the screen resolution as the parameters of the program. Running the program like this:

    Java Code:
    java example 800 600
    You can get the arguments in the code like this:

    Java Code:
    public static void main(String[] args) {
    
    // args[0] is 800
    // args[1] is 600
    
    }

  3. #3
    Y. Progammer is offline Member
    Join Date
    Feb 2010
    Posts
    68
    Rep Power
    0

    Default

    The approach you mentioned is static .. i want to deploy the application at the client site .. and in that case i think the approach should b kinda dynamic:rolleyes:

  4. #4
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by Y. Progammer View Post
    The approach you mentioned is static .. i want to deploy the application at the client site .. and in that case i think the approach should b kinda dynamic:rolleyes:
    The static keyword in this case refers to the main() method, and it means that there is one main() method for the entire class -- individual instances don't get their own main() methods. The main() method is always static.

    As far as getting the screen dimensions from the environment, that depends on the framework you're using. If you're using awt, for example, you can find your answer here:

    Q&A : How can I find out the current screen resolution?

    -Gary-

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,336
    Blog Entries
    7
    Rep Power
    20

    Default

    You don't need to know the screen resolution, the Frame.setExtendedState(Frame.MAXIMIZED_BOTH) method sets the (J)Frame to the entire screen.

    kind regards,

    Jos

Similar Threads

  1. Full Screen Frame Resolution Problem
    By Krooger in forum AWT / Swing
    Replies: 2
    Last Post: 11-24-2009, 11:05 PM
  2. passing parameters to next jsp using javascript
    By sridevisala in forum New To Java
    Replies: 0
    Last Post: 11-20-2009, 05:34 AM
  3. Screen Resolution Problems
    By RicKaufman in forum AWT / Swing
    Replies: 1
    Last Post: 10-04-2009, 06:07 PM
  4. Prob. with screen resolution and Frame size??
    By SANDY_INDIA in forum AWT / Swing
    Replies: 1
    Last Post: 08-16-2008, 12:51 PM
  5. passing parameters to paint mtd
    By themburu in forum Java Applets
    Replies: 3
    Last Post: 07-14-2008, 08:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •