Results 1 to 4 of 4
  1. #1
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default Using setBounds (x.y,width,height) constructor

    Dear all,

    I am using JWindow setBounds constructor. Now how am supposed to know the arguments to pass into the constructor. How do I know what is the pixel of the screen and so on?:confused:

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default

    setBounds is a method, not a constructor.

    java.awt.Toolkit#getScreenSize / getScreenResolution

    db

  3. #3
    hitmen is offline Member
    Join Date
    Oct 2008
    Posts
    58
    Rep Power
    0

    Default

    I know it is a method. I am asking how am I supposed to know the pixel values to pass into the setbound(x,y,width,height) constructor?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default

    Can't tell from the way you ask that, but maybe you need to go through this:
    Lesson: Laying Out Components Within a Container (The Java™ Tutorials > Creating a GUI with JFC/Swing)

    db

    edit And if you KNOW it's a method, why do you keep on misusing the word CONSTRUCTOR?

Similar Threads

  1. Get Image Height and Width
    By neeraj.singh in forum AWT / Swing
    Replies: 10
    Last Post: 02-18-2009, 01:09 PM
  2. Replies: 4
    Last Post: 06-25-2008, 08:09 PM
  3. Problem here guys: Set location or setBounds
    By themburu in forum New To Java
    Replies: 3
    Last Post: 06-03-2008, 07:19 PM
  4. Replies: 0
    Last Post: 12-19-2007, 09:10 AM
  5. dynamising the height of a JPopupMenu
    By iimasd in forum AWT / Swing
    Replies: 6
    Last Post: 11-21-2007, 10:01 AM

Posting Permissions

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