Awt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sriramshree
    New Member
    • Aug 2007
    • 2

    #1

    Awt

    In java2 awt, if i create a button in appletviewer it is always on top default. How to customize the button position.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by sriramshree
    In java2 awt, if i create a button in appletviewer it is always on top default. How to customize the button position.
    Check out LayoutManagers

    kind regards,

    Jos

    Comment

    • praveen2gupta
      New Member
      • May 2007
      • 200

      #3
      Originally posted by sriramshree
      In java2 awt, if i create a button in appletviewer it is always on top default. How to customize the button position.
      Hi
      To set a component to a defined position we have to use LayoutManagers.
      Some of LayoutManagers are FlowLayout, BorderLayout, GridLayout
      each Layout gives you a pre defined setting on the applet. Use appropriate one as per requirement.

      Comment

      • sriramshree
        New Member
        • Aug 2007
        • 2

        #4
        Dear Sir,

        i have used Grid Layout, in that button position is defaultly shown in appletviewer. How set the button for my own position, for example i have to set my button (80,350). Can you give a simple code for that?

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Originally posted by sriramshree
          Dear Sir,

          i have used Grid Layout, in that button position is defaultly shown in appletviewer. How set the button for my own position, for example i have to set my button (80,350). Can you give a simple code for that?
          If you want to position your button to an absolute position (relative to the frame
          in which it is stored) you should set the LayoutManager to null; note that this
          is considered bad practice.

          kind regards,

          Jos

          Comment

          Working...