Perry Smith

Java Questions & Answers

Home / Java Q & A Page 2 / Java Q & A Archive Main Page

positioning components in window
 Thursday, 05-Nov-98 22:52:34

      209.103.24.202 writes:

      How can I control the position of components
      in a window. For example I want to display
      labels with textboxes next to each label all
      aligned vertically.
      ex : label1: text1
      label2: text2

      I want to be able to control the x and y positions of each component separately, placing
      them anywhere freely and remaining there when window sized.

      I tried using different layout managers but perhaps I do not have enough info.
      Can I get an example code of let's say a data
      entry interface :


      ptelaro@sprint.ca

Responses
Responses
Re: positioning components in window
 Wednesday, 11-Nov-98 14:06:01

      148.5.110.65 writes:

      ptelaro,

      I have had the same fustration. The best that I could come up with was to put the
      components that I want together in a Panel which in turn is in the window.

      Scott

      Scott_M2

Re: Re: positioning components in window
 Wednesday, 11-Nov-98 16:23:53

      148.5.110.65 writes:

      You can also try calling theComponent.setLocation(x, y);
      in the windows paint method. I don't really like either solution but...

Home / Java Q & A Page 2 / Java Q & A Archive Main Page