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

    Default how to set position for jlist on frame??

    i created jlist and i added it to the frame i can change the height and width but i want to change the position of the list on the frame, i mean the x-postion and the y postion.

    list_box tx = new list_box(subject);

    tx.setPreferredSize(new Dimension(200, 400)); ////list box size
    tx.setBackground(Color.yellow);

    this.add(tv); // add th list to the frame

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    I'd suggest using a layout manager to determine both the position and the size of your component.

  3. #3
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

  4. #4
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    I was trying to avoid moving this post to the top of the list, but I am now going to say this.

    TO ALL POSTERS: This thread was double posted (whether intentionally or through some error). Please reply at this thread

    P.S Yes, I know pbrockway2 mentioned this, just making it clearer :D
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. get position in string from caret position
    By helloworld111 in forum AWT / Swing
    Replies: 5
    Last Post: 02-19-2009, 01:36 AM
  2. How to request position to the satelite?
    By vandawaa in forum New To Java
    Replies: 0
    Last Post: 01-10-2009, 04:21 PM
  3. BorderFactory to set position?
    By aleplgr in forum AWT / Swing
    Replies: 2
    Last Post: 01-30-2008, 12:46 PM
  4. Help with position in java
    By fernando in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 07:54 PM
  5. Use the mouse position
    By susan in forum Java Applets
    Replies: 1
    Last Post: 07-28-2007, 11:10 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
  •