• Post Reply Bookmark Topic Watch Topic
  • New Topic

swing layout weirdness  RSS feed

 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone please explain to me why this slider is firmly planted in the center of the frame, no matter resizing? I realize the program itself is not working properly at the moment. but for the sake of the layout itself, no matter what i change, dimensions, preferred size, setBounds, the slider is always in the center. any help would be appreciated.



i just want the slider to be under the "your height" label. thanks.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can see your layout is a vertical Box with three components. The slider is the middle component, so where else could it be but in the middle of the screen? Oh, wait a minute, I just looked at the code for the fourth time and noticed that you added the slider to the GUI in two different places. The first place is the place where you say you wanted it and the second place is the one you don't like.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:As far as I can see your layout is a vertical Box with three components. The slider is the middle component, so where else could it be but in the middle of the screen? Oh, wait a minute, I just looked at the code for the fourth time and noticed that you added the slider to the GUI in two different places. The first place is the place where you say you wanted it and the second place is the one you don't like.


thanks for the response. where did i add it a second time? i'm combing over this and only see me declaring it once, then giving it a value later...
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
67 and 91.
 
David Borchgrevink
Ranch Hand
Posts: 93
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:67 and 91.
i feel stupid now. thanks for pointing that out
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It happens to all of us. The traditional phrase to acknowledge that sort of thing these days is "D'oh!".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!