Results 1 to 2 of 2
  1. #1
    danpotter is offline Member
    Join Date
    May 2011
    Posts
    43
    Rep Power
    0

    Default setting contents of frame in the center even after max and minimize help!!!

    well i made a frame and created all buttons,text fields,labels etc....

    the size of the frame is done as setSize(500,500); and i used setbounds like below

    lbl1.setBounds(50,200,80,20);
    lbl2.setBounds(50,250,80,20);
    lbl3.setBounds(50,80,350,100);
    lbl4.setBounds(100,350,350,100);

    name.setBounds(150,200,120,25);
    pswd.setBounds(150,250,120,25);
    setLayout(null);

    b1.setBounds(200,300,50,30);


    now when i click Restore or resize button on window[which is right to minimize button and left to close button] the frame is on full screen,fine...,but the contents[components] of the frame are are remaining in same position..but i dont want like that..i want like,if i click resize button..the content of the frame shuld come to center of frame.. please help me for that...

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,201
    Rep Power
    19

    Default Re: setting contents of frame in the center even after max and minimize help!!!

    Learn to use a layout manager ( http://docs.oracle.com/javase/tutori...out/index.html ), and learn to post in the correct section of the forum.

    Moving from New to Java to AWT/Swing

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. frame not displaying correct contents
    By yemista in forum AWT / Swing
    Replies: 5
    Last Post: 10-20-2011, 05:30 PM
  2. Replies: 4
    Last Post: 01-18-2011, 08:22 AM
  3. Setting up a frame
    By Pencil in forum New To Java
    Replies: 4
    Last Post: 11-21-2010, 02:16 PM
  4. Replies: 4
    Last Post: 10-30-2009, 10:38 PM
  5. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 04:37 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
  •