CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    9

    JLabels in Swings.

    Hi,
    How to position the JLabels other than using the left righ& center align. Can we use setBounds in JApplets like in AWT(APPLETS).B'coz in my prg of swings only the textfields & buttons are seen , the labels are not seen. How to place JLabels &JTextFields,JButtons etc in reqd position. Pl. educate how to format the screen in swings in reqd. x,y co-ordinates of our choice.



  2. #2
    Join Date
    Sep 2000
    Location
    Singapore
    Posts
    5

    Re: JLabels in Swings.

    Hi ,
    Yes U can use setBounds to position labels.
    But its not preferred.U can also use gridbag layout to exactly position components.
    If U find that complex,the best way is to add components to Jpanels and use a setPreferredSize method for those panels which will exactly fit the components in the required position.

    Eg. labelPanel.setPreferredSize( new Dimension (x,y) );

    Hope this will help u.
    If u have any more doubt reply to [email protected]

    Best regards
    Praveen.C

    When going gets tough,
    Tough gets going.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured